diff src/share/vm/classfile/verifier.cpp @ 17583:b5ae226b7516

8037157: Verify <init> call Summary: Check for null method Reviewed-by: coleenp, acorn, mschoene
author hseigel
date Mon, 07 Apr 2014 09:27:31 -0400
parents aff11567504c
children e6b738407432 364b73402247 2373a1f4987c
line wrap: on
line diff
--- a/src/share/vm/classfile/verifier.cpp	Thu Apr 03 11:46:36 2014 -0700
+++ b/src/share/vm/classfile/verifier.cpp	Mon Apr 07 09:27:31 2014 -0400
@@ -2307,6 +2307,11 @@
       Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
         vmSymbols::object_initializer_name(),
         cp->signature_ref_at(bcs->get_index_u2()));
+      if (m == NULL) {
+        verify_error(ErrorContext::bad_code(bci),
+            "Call to missing <init> method");
+        return;
+      }
       instanceKlassHandle mh(THREAD, m->method_holder());
       if (m->is_protected() && !mh->is_same_class_package(_klass())) {
         bool assignable = current_type().is_assignable_from(