diff --git a/java/packagescanner.go b/java/packagescanner.go index be8f27a8d..da8d79cbf 100644 --- a/java/packagescanner.go +++ b/java/packagescanner.go @@ -174,9 +174,9 @@ func (s *Scanner) Scan(ctx context.Context, layer *claircore.Layer) ([]*claircor infos, err := jar.Parse(ctx, n, z) switch { case err == nil: - case errors.Is(err, jar.ErrUnidentified) || errors.Is(err, jar.ErrNotAJar): - // If there's an error that's one of the "known" reasons (e.g. not a - // read error or a malformed file), just log it and continue on. + case errors.Is(err, jar.ErrUnidentified) || errors.Is(err, jar.ErrNotAJar) || errors.Is(err, zip.ErrFormat): + // If there's an error that's one of the "known" reasons (e.g. not a read error), + // just log it and continue on. zlog.Info(ctx). AnErr("reason", err). Msg("skipping jar")