提交 b2bc82b6 编写于 作者: L langel

6852607: MessageUtils JVM crash

Summary: Fixes crash by checking null field
Reviewed-by: alanb
上级 42c18753
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册