jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp

Print this page
rev 5678 : 7186957: Improve Pack200 data validation
Reviewed-by: jrose, jjh, mschoene

@@ -185,10 +185,14 @@
   setIndex(u->cp.getIndex(tag));
 }
 
 entry* band::getRefCommon(cpindex* ix_, bool nullOKwithCaller) {
   CHECK_0;
+  if (ix_ == NULL) {
+      abort("no index");
+      return NULL;
+  }
   assert(ix_->ixTag == ixTag
          || (ixTag == CONSTANT_Literal
              && ix_->ixTag >= CONSTANT_Integer
              && ix_->ixTag <= CONSTANT_String));
   int n = vs[0].getInt() - nullOK;