diff --git a/src/windows/native/sun/windows/awt_DataTransferer.cpp b/src/windows/native/sun/windows/awt_DataTransferer.cpp index 77a87b2028dbcda309b0f76a027daa5a5ea3df1a..9ebc2c60eeef678efbebdbae537e7529439aa533 100644 --- a/src/windows/native/sun/windows/awt_DataTransferer.cpp +++ b/src/windows/native/sun/windows/awt_DataTransferer.cpp @@ -274,6 +274,9 @@ Java_sun_awt_windows_WDataTransferer_dragQueryFile 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 @@ Java_sun_awt_windows_WDataTransferer_registerClipboardFormat(JNIEnv *env, TRY; LPCTSTR cStr = JNU_GetStringPlatformChars(env, str, NULL); + CHECK_NULL_RETURN(cStr, 0); jlong value = ::RegisterClipboardFormat(cStr); JNU_ReleaseStringPlatformChars(env, str, cStr);