hotspot/src/share/vm/prims/jvmtiEnv.cpp
changeset 44406 a46a6c4d1dd9
parent 44093 e22e0d071bf9
child 44520 0553e129e0ec
child 46369 3bf4544bec14
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Mar 21 16:36:12 2017 +0100
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Wed Mar 22 15:25:21 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -1796,6 +1796,13 @@
     }
   }
 
+  if (initial_object != NULL) {
+    oop init_obj = JNIHandles::resolve_external_guard(initial_object);
+    if (init_obj == NULL) {
+      return JVMTI_ERROR_INVALID_OBJECT;
+    }
+  }
+
   Thread *thread = Thread::current();
   HandleMark hm(thread);
   KlassHandle kh (thread, k_oop);