Skip to content

Commit

Permalink
Use zipContains for Jar check.
Browse files Browse the repository at this point in the history
Fixes #201
  • Loading branch information
gabriel-vasile committed Nov 17, 2021
1 parent e4d5da0 commit 77cba4a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions internal/magic/zip.go
Expand Up @@ -43,14 +43,7 @@ func Zip(raw []byte, limit uint32) bool {

// Jar matches a Java archive file.
func Jar(raw []byte, limit uint32) bool {
t := zipTokenizer{in: raw}
for i, tok := 0, t.next(); i < 10 && tok != ""; i, tok = i+1, t.next() {
if tok == "META-INF/MANIFEST.MF" {
return true
}
}

return false
return zipContains(raw, "META-INF/MANIFEST.MF")
}

// zipTokenizer holds the source zip file and scanned index.
Expand Down

0 comments on commit 77cba4a

Please sign in to comment.