8035855: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp
authorpchelko
Thu, 27 Feb 2014 16:11:16 +0400
changeset 23323 f44d37f9351c
parent 23322 d3267402aaae
child 23324 fb6002beb0ce
8035855: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp Reviewed-by: anthony, serb
jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp
--- a/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp	Wed Feb 26 11:55:45 2014 +0400
+++ b/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp	Thu Feb 27 16:11:16 2014 +0400
@@ -274,6 +274,9 @@
 
         jclass str_clazz = env->FindClass("java/lang/String");
         DASSERT(str_clazz != NULL);
+        if (str_clazz == NULL) {
+           throw std::bad_alloc();
+        }
         jobjectArray filenames = env->NewObjectArray(nFilenames, str_clazz,
                                                      NULL);
         if (filenames == NULL) {
@@ -827,6 +830,7 @@
     TRY;
 
     LPCTSTR cStr = JNU_GetStringPlatformChars(env, str, NULL);
+    CHECK_NULL_RETURN(cStr, 0);
     jlong value = ::RegisterClipboardFormat(cStr);
     JNU_ReleaseStringPlatformChars(env, str, cStr);