From 9c169ac700f77b1847a082ca0b0a67785763490d Mon Sep 17 00:00:00 2001 From: azvegint Date: Wed, 5 Mar 2014 16:33:00 +0400 Subject: [PATCH] 8035858: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_Desktop.cpp Reviewed-by: serb, pchelko --- src/windows/native/sun/windows/awt_Desktop.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/windows/native/sun/windows/awt_Desktop.cpp b/src/windows/native/sun/windows/awt_Desktop.cpp index 623718e42..828818bad 100644 --- a/src/windows/native/sun/windows/awt_Desktop.cpp +++ b/src/windows/native/sun/windows/awt_Desktop.cpp @@ -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 #include @@ -41,7 +42,12 @@ JNIEXPORT jstring JNICALL Java_sun_awt_windows_WDesktopPeer_ShellExecute (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); -- GitLab