From: <eli...@us...> - 2007-03-09 14:28:54
|
Revision: 2748 http://svn.sourceforge.net/java-game-lib/?rev=2748&view=rev Author: elias_naur Date: 2007-03-09 06:28:52 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Added error checking to NewStringNative Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2007-03-06 14:48:35 UTC (rev 2747) +++ trunk/LWJGL/src/native/common/common_tools.c 2007-03-09 14:28:52 UTC (rev 2748) @@ -210,7 +210,11 @@ } jcls_str = (*env)->FindClass(env,"java/lang/String"); + if (jcls_str == NULL) + return NULL; jmethod_str = (*env)->GetMethodID(env,jcls_str, "<init>", "([B)V"); + if (jmethod_str == NULL) + return NULL; bytes = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-03-09 14:34:28
|
Revision: 2749 http://svn.sourceforge.net/java-game-lib/?rev=2749&view=rev Author: elias_naur Date: 2007-03-09 06:34:27 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Added error checking to getBooleanProperty Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2007-03-09 14:28:52 UTC (rev 2748) +++ trunk/LWJGL/src/native/common/common_tools.c 2007-03-09 14:34:27 UTC (rev 2749) @@ -290,8 +290,14 @@ bool getBooleanProperty(JNIEnv *env, const char* propertyName) { jstring property = NewStringNative(env, propertyName); + if (property == NULL) + return false; jclass org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil"); + if (org_lwjgl_LWJGLUtil_class == NULL) + return false; jmethodID getBoolean = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "getPrivilegedBoolean", "(Ljava/lang/String;)Z"); + if (getBoolean == NULL) + return false; return (*env)->CallStaticBooleanMethod(env, org_lwjgl_LWJGLUtil_class, getBoolean, property) ? true : false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-03-30 19:01:02
|
Revision: 2752 http://svn.sourceforge.net/java-game-lib/?rev=2752&view=rev Author: elias_naur Date: 2007-03-30 12:00:59 -0700 (Fri, 30 Mar 2007) Log Message: ----------- Windows: Native compile fixes Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2007-03-22 14:05:41 UTC (rev 2751) +++ trunk/LWJGL/src/native/common/common_tools.c 2007-03-30 19:00:59 UTC (rev 2752) @@ -290,12 +290,14 @@ bool getBooleanProperty(JNIEnv *env, const char* propertyName) { jstring property = NewStringNative(env, propertyName); + jclass org_lwjgl_LWJGLUtil_class; + jmethodID getBoolean; if (property == NULL) return false; - jclass org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil"); + org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil"); if (org_lwjgl_LWJGLUtil_class == NULL) return false; - jmethodID getBoolean = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "getPrivilegedBoolean", "(Ljava/lang/String;)Z"); + getBoolean = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "getPrivilegedBoolean", "(Ljava/lang/String;)Z"); if (getBoolean == NULL) return false; return (*env)->CallStaticBooleanMethod(env, org_lwjgl_LWJGLUtil_class, getBoolean, property) ? true : false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-25 17:22:04
|
Revision: 3046 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3046&view=rev Author: elias_naur Date: 2008-04-25 10:21:59 -0700 (Fri, 25 Apr 2008) Log Message: ----------- NewStringNativeUnsigned should return NULL if argument string is NULL Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 02:18:27 UTC (rev 3045) +++ trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 17:21:59 UTC (rev 3046) @@ -201,8 +201,11 @@ /* creates locale specific string, unsigned argument to * match GLuchar and ALuchar types */ -jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str) { - return NewStringNativeWithLength(env, (const char *)str, strlen((const char *)str)); +jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *ustr) { + const char *str = (const char *)ustr; + if (str == NULL) + return NULL; + return NewStringNativeWithLength(env, str, strlen(str)); } // creates locale specific string This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |