From 43274230b4046dc66d14d885ec5fcbb7ffa92ae9 Mon Sep 17 00:00:00 2001 From: "nicolson%netscape.com" Date: Wed, 19 Jun 2002 22:59:08 +0000 Subject: [PATCH] catch a null pointer and throw it back to Java, instead of crashing in C. --- security/jss/org/mozilla/jss/util/jssutil.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/security/jss/org/mozilla/jss/util/jssutil.c b/security/jss/org/mozilla/jss/util/jssutil.c index 1032c99f837a..4e4ecaa3a298 100644 --- a/security/jss/org/mozilla/jss/util/jssutil.c +++ b/security/jss/org/mozilla/jss/util/jssutil.c @@ -226,6 +226,10 @@ JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr) int size; PR_ASSERT(env!=NULL && nativeProxy != NULL && ptr != NULL); + if( nativeProxy == NULL ) { + JSS_throw(env, NULL_POINTER_EXCEPTION); + return PR_FAILURE; + } proxyClass = (*env)->GetObjectClass(env, nativeProxy); PR_ASSERT(proxyClass != NULL);