8273826: Correct Manifest file name and NPE checks

Reviewed-by: weijun, hchao, mullan
This commit is contained in:
Sean Coffey 2021-10-07 15:12:13 +00:00
parent 722d639fad
commit 03a8d342b8
5 changed files with 137 additions and 11 deletions

View file

@ -749,7 +749,7 @@ public class JarFile extends ZipFile {
}
if (mev == null) {
mev = new ManifestEntryVerifier
(getManifestFromReference());
(getManifestFromReference(), jv.manifestName);
}
if (name.equalsIgnoreCase(MANIFEST_NAME)) {
b = jv.manifestRawBytes;

View file

@ -95,7 +95,7 @@ public class JarInputStream extends ZipInputStream {
closeEntry();
if (doVerify) {
jv = new JarVerifier(e.getName(), bytes);
mev = new ManifestEntryVerifier(man);
mev = new ManifestEntryVerifier(man, jv.manifestName);
}
return (JarEntry)super.getNextEntry();
}

View file

@ -444,7 +444,7 @@ class JarVerifier {
{
this.is = Objects.requireNonNull(is);
this.jv = jv;
this.mev = new ManifestEntryVerifier(man);
this.mev = new ManifestEntryVerifier(man, jv.manifestName);
this.jv.beginEntry(je, mev);
this.numLeft = je.getSize();
if (this.numLeft == 0)