hotspot/src/share/vm/prims/jvmtiEnv.cpp
changeset 44088 fb5421685295
parent 43969 ae5c415036b0
child 44093 e22e0d071bf9
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Feb 28 10:10:14 2017 +0530
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Fri Feb 17 13:16:54 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);