jni.cc (_Jv_JNI_GetStringUTFChars): Fail gracefully if string is null.
* jni.cc (_Jv_JNI_GetStringUTFChars): Fail gracefully if string is null. From-SVN: r73707
This commit is contained in:
parent
b9c5315018
commit
6c363de7ea
@ -1,3 +1,8 @@
|
||||
2003-11-18 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* jni.cc (_Jv_JNI_GetStringUTFChars): Fail gracefully if string
|
||||
is null.
|
||||
|
||||
2003-11-17 Graydon Hoare <graydon@redhat.com>
|
||||
|
||||
* javax/swing/plaf/basic/BasicDefaults.java: Rewrite to spec.
|
||||
|
@ -1298,10 +1298,12 @@ static const char *
|
||||
(JNICALL _Jv_JNI_GetStringUTFChars) (JNIEnv *env, jstring string,
|
||||
jboolean *isCopy)
|
||||
{
|
||||
string = unwrap (string);
|
||||
jsize len = JvGetStringUTFLength (string);
|
||||
try
|
||||
{
|
||||
string = unwrap (string);
|
||||
if (string == NULL)
|
||||
return NULL;
|
||||
jsize len = JvGetStringUTFLength (string);
|
||||
char *r = (char *) _Jv_Malloc (len + 1);
|
||||
JvGetStringUTFRegion (string, 0, string->length(), r);
|
||||
r[len] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user