From eeb711239ed9e3c73fffef78019ad2f519d2b4e9 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 9 Mar 2007 14:28:52 +0000 Subject: [PATCH] Added error checking to NewStringNative --- src/native/common/common_tools.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/native/common/common_tools.c b/src/native/common/common_tools.c index 90476d2b..081c25a0 100644 --- a/src/native/common/common_tools.c +++ b/src/native/common/common_tools.c @@ -210,7 +210,11 @@ jstring NewStringNative(JNIEnv *env, const char *str) { } jcls_str = (*env)->FindClass(env,"java/lang/String"); + if (jcls_str == NULL) + return NULL; jmethod_str = (*env)->GetMethodID(env,jcls_str, "", "([B)V"); + if (jmethod_str == NULL) + return NULL; bytes = 0;