Fix potential security exploit in generated Java classes
This commit is contained in:
parent
130834aac2
commit
a1771cb8a0
7 changed files with 42 additions and 27 deletions
|
|
@ -2390,8 +2390,8 @@ The default proxy class for our previous example looks like this:
|
|||
<div class="code">
|
||||
<pre>
|
||||
public class Foo {
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
private transient long swigCPtr;
|
||||
protected transient boolean swigCMemOwn;
|
||||
|
||||
protected Foo(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
|
|
@ -2641,8 +2641,8 @@ The base class is generated much like any other proxy class seen so far:
|
|||
|
||||
<div class="code"><pre>
|
||||
public class Base {
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
private transient long swigCPtr;
|
||||
protected transient boolean swigCMemOwn;
|
||||
|
||||
protected Base(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
|
|
@ -2682,7 +2682,7 @@ The <tt>Derived</tt> class extends <tt>Base</tt> mirroring the C++ class inherit
|
|||
|
||||
<div class="code"><pre>
|
||||
public class Derived extends Base {
|
||||
private long swigCPtr;
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected Derived(long cPtr, boolean cMemoryOwn) {
|
||||
super(exampleJNI.SWIGDerivedUpcast(cPtr), cMemoryOwn);
|
||||
|
|
@ -2960,8 +2960,8 @@ and the Java proxy class generated by SWIG:
|
|||
|
||||
<div class="code"><pre>
|
||||
public class Test {
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
private transient long swigCPtr;
|
||||
protected transient boolean swigCMemOwn;
|
||||
|
||||
protected Test(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
|
|
@ -3034,7 +3034,7 @@ The generated type wrapper class, for say an <tt>int *</tt>, looks like this:
|
|||
|
||||
<div class="code"><pre>
|
||||
public class SWIGTYPE_p_int {
|
||||
private long swigCPtr;
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected SWIGTYPE_p_int(long cPtr, boolean bFutureUse) {
|
||||
swigCPtr = cPtr;
|
||||
|
|
@ -5900,8 +5900,8 @@ If you are invoking SWIG more than once and generating the wrapped classes into
|
|||
<div class="code">
|
||||
<pre>
|
||||
%typemap(javabody) SWIGTYPE %{
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
private transient long swigCPtr;
|
||||
protected transient boolean swigCMemOwn;
|
||||
|
||||
protected $javaclassname(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
|
|
@ -5929,7 +5929,7 @@ For the typemap to be used in all type wrapper classes, all the different types
|
|||
<div class="code">
|
||||
<pre>
|
||||
%typemap(javabody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{
|
||||
private long swigCPtr;
|
||||
private transient long swigCPtr;
|
||||
|
||||
protected $javaclassname(long cPtr, boolean bFutureUse) {
|
||||
swigCPtr = cPtr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue