8035858: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_Desktop.cpp
authorazvegint
Wed, 05 Mar 2014 16:33:00 +0400
changeset 23621 b253f11270a8
parent 23620 7fa801594d75
child 23622 4c4209f64f9c
8035858: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_Desktop.cpp Reviewed-by: serb, pchelko
jdk/src/windows/native/sun/windows/awt_Desktop.cpp
--- a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp	Wed Mar 05 16:01:22 2014 +0400
+++ b/jdk/src/windows/native/sun/windows/awt_Desktop.cpp	Wed Mar 05 16:33:00 2014 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  * questions.
  */
 
+#include "jni_util.h"
 #include "awt.h"
 #include <jni.h>
 #include <shellapi.h>
@@ -41,7 +42,12 @@
   (JNIEnv *env, jclass cls, jstring fileOrUri_j, jstring verb_j)
 {
     LPCWSTR fileOrUri_c = JNU_GetStringPlatformChars(env, fileOrUri_j, JNI_FALSE);
+    CHECK_NULL_RETURN(fileOrUri_c, NULL);
     LPCWSTR verb_c = JNU_GetStringPlatformChars(env, verb_j, JNI_FALSE);
+    if (verb_c == NULL) {
+        JNU_ReleaseStringPlatformChars(env, fileOrUri_j, fileOrUri_c);
+        return NULL;
+    }
 
     // 6457572: ShellExecute possibly changes FPU control word - saving it here
     unsigned oldcontrol87 = _control87(0, 0);