Commit 6c363de7 by Tom Tromey Committed by Tom Tromey

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
parent b9c53150
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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment