mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-16 21:35:25 +00:00
6852607: MessageUtils JVM crash
Fixes crash by checking null field Reviewed-by: alanb
This commit is contained in:
parent
1ece67558e
commit
9feab8fb3a
@ -39,6 +39,11 @@ printToFile(JNIEnv *env, jstring s, FILE *file)
|
||||
int i;
|
||||
const jchar *sAsArray;
|
||||
|
||||
if (s == NULL) {
|
||||
s = (*env)->NewStringUTF(env, "null");
|
||||
if (s == NULL) return;
|
||||
}
|
||||
|
||||
sAsArray = (*env)->GetStringChars(env, s, NULL);
|
||||
length = (*env)->GetStringLength(env, s);
|
||||
sConverted = (char *) malloc(length + 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user