The .jar file in the aforementioned issue failed to extract:
time=2024-09-15T21:08:02.374-04:00 level=ERROR source=/Users/t/src/bincapz/pkg/action/scan.go:233 msg="unable to process ../malware/Downloads/909a19d0de5476e249c133f73c4afa288982d05dcf4ca597fa8357d93f435c47.jar: extract to temp: failed to extract ../malware/Downloads/909a19d0de5476e249c133f73c4afa288982d05dcf4ca597fa8357d93f435c47.jar: failed to open zip file ../malware/Downloads/909a19d0de5476e249c133f73c4afa288982d05dcf4ca597fa8357d93f435c47.jar: zip: not a valid zip file"
Which means the frs Map was not populated (i.e., was still nil) before we tried to use the Range() method (and we're passing in a pointer to the Map via frs *sync.Map):
frs.Range(func(_, value any) bool {
...
}
This PR should handle cases like this more resiliently.
Closes https://github.com/chainguard-dev/bincapz/issues/458
The
.jar
file in the aforementioned issue failed to extract:Which means the
frs
Map was not populated (i.e., was stillnil
) before we tried to use theRange()
method (and we're passing in a pointer to the Map viafrs *sync.Map
):This PR should handle cases like this more resiliently.