mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
Fix wrong break (fanal#38)
This commit is contained in:
@@ -33,7 +33,10 @@ func (a rpmPkgAnalyzer) Analyze(fileMap extractor.FileMap) (pkgs []analyzer.Pack
|
||||
if !detected {
|
||||
return nil, analyzer.ErrNoPkgsDetected
|
||||
}
|
||||
return pkgs, xerrors.Errorf("failed to parse the pkg info: %w", err)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to parse the pkg info: %w", err)
|
||||
}
|
||||
return pkgs, nil
|
||||
}
|
||||
|
||||
func (a rpmPkgAnalyzer) parsePkgInfo(packageBytes []byte) (pkgs []analyzer.Package, err error) {
|
||||
|
||||
@@ -36,7 +36,10 @@ func (a rpmCmdPkgAnalyzer) Analyze(fileMap extractor.FileMap) (pkgs []analyzer.P
|
||||
if !detected {
|
||||
return pkgs, analyzer.ErrNoPkgsDetected
|
||||
}
|
||||
return pkgs, xerrors.Errorf("failed to parse the pkg info: %w", err)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to parse the pkg info: %w", err)
|
||||
}
|
||||
return pkgs, nil
|
||||
}
|
||||
|
||||
func (a rpmCmdPkgAnalyzer) parsePkgInfo(packageBytes []byte) (pkgs []analyzer.Package, err error) {
|
||||
|
||||
@@ -340,9 +340,9 @@ func (d DockerExtractor) ExtractFiles(layer io.Reader, filenames []string) (extr
|
||||
if s[len(s)-1] == '/' {
|
||||
if filepath.Clean(s) == filepath.Dir(filePath) {
|
||||
extract = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if s == filePath || s == fileName || strings.HasPrefix(fileName, wh) {
|
||||
extract = true
|
||||
|
||||
Reference in New Issue
Block a user