changeset 17366:9a0ef04757f9

8162524: src/jdk.management/share/native/libmanagement_ext/Flag.c doesn't handle JNI exceptions Summary: add missed exception check Reviewed-by: dholmes, hb, dsamersoff Contributed-by: amit.sapre@oracle.com
author dsamersoff
date Mon, 01 Aug 2016 13:53:55 +0300
parents 02651d14d282
children 8f1d366691a2 ecc9399771ac
files src/jdk.management/share/native/libmanagement_ext/Flag.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.management/share/native/libmanagement_ext/Flag.c	Mon Aug 01 10:51:32 2016 +0300
+++ b/src/jdk.management/share/native/libmanagement_ext/Flag.c	Mon Aug 01 13:53:55 2016 +0300
@@ -141,6 +141,13 @@
             // ignore unsupported type
             continue;
         }
+
+        if (valueObj == NULL) {
+            free(globals);
+            JNU_ThrowOutOfMemoryError(env, 0);
+            return 0;
+        }
+
         switch (globals[i].origin) {
         case JMM_VMGLOBAL_ORIGIN_DEFAULT:
             origin = default_origin;