changeset 23323:f44d37f9351c

8035855: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp Reviewed-by: anthony, serb
author pchelko
date Thu, 27 Feb 2014 16:11:16 +0400
parents d3267402aaae
children fb6002beb0ce
files jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);