Skip to content

Commit

Permalink
Merge pull request strazzere#7 from reox/master
Browse files Browse the repository at this point in the history
Fixing data descriptor read without flag set
  • Loading branch information
strazzere committed Sep 21, 2015
2 parents 61ab1fb + a5c668c commit 90a630f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Templates/ZIPTemplateAdv.bt
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,9 @@ while( !FEof() )
Printf("Pointing at %d\n", FTell());
}
}

if(!isJar && record.frCompressedSize == 0 && record.frUncompressedSize == 0)

// Only read the data descriptor if bit 3 of the flags is set. Otherwise there is no data descriptor present!
if(!isJar && (record.frFlags & FLAG_DescriptorUsedMask) && record.frCompressedSize == 0 && record.frUncompressedSize == 0)
{
Printf("Doesn't appear to jar, but going to attempt to parse as one; skipping to dataDescription\n");
// Skip data if need be, since a JAR doesn't properly set the
Expand Down

0 comments on commit 90a630f

Please sign in to comment.