Fix unintended uninitialised memory access in OUTPUT typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13074 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d9393bc22a
commit
4dfe131207
2 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 2.0.7 (in progress)
|
Version 2.0.7 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2012-05-11: wsfulton
|
||||||
|
[Java] SF patch #3522855 Fix unintended uninitialised memory access in OUTPUT typemaps.
|
||||||
|
|
||||||
2012-05-11: wsfulton
|
2012-05-11: wsfulton
|
||||||
[Java] SF patch #3522674 Fix possible uninitialised memory access in char **STRING_OUT
|
[Java] SF patch #3522674 Fix possible uninitialised memory access in char **STRING_OUT
|
||||||
typemap.
|
typemap.
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ There are no char *OUTPUT typemaps, however you can apply the signed char * type
|
||||||
SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element");
|
SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element");
|
||||||
return $null;
|
return $null;
|
||||||
}
|
}
|
||||||
|
temp = ($*1_ltype)0;
|
||||||
$1 = &temp;
|
$1 = &temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,6 +227,20 @@ OUTPUT_TYPEMAP(double, jdouble, double, Double, "[Ljava/lang/Double;", jdoubleAr
|
||||||
|
|
||||||
#undef OUTPUT_TYPEMAP
|
#undef OUTPUT_TYPEMAP
|
||||||
|
|
||||||
|
%typemap(in) bool *OUTPUT($*1_ltype temp), bool &OUTPUT($*1_ltype temp)
|
||||||
|
{
|
||||||
|
if (!$input) {
|
||||||
|
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null");
|
||||||
|
return $null;
|
||||||
|
}
|
||||||
|
if (JCALL1(GetArrayLength, jenv, $input) == 0) {
|
||||||
|
SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element");
|
||||||
|
return $null;
|
||||||
|
}
|
||||||
|
temp = false;
|
||||||
|
$1 = &temp;
|
||||||
|
}
|
||||||
|
|
||||||
/* Convert to BigInteger - byte array holds number in 2's complement big endian format */
|
/* Convert to BigInteger - byte array holds number in 2's complement big endian format */
|
||||||
/* Use first element in BigInteger array for output */
|
/* Use first element in BigInteger array for output */
|
||||||
/* Overrides the typemap in the OUTPUT_TYPEMAP macro */
|
/* Overrides the typemap in the OUTPUT_TYPEMAP macro */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue