fix: go version not properly identified in binary (#1384)

This commit is contained in:
Keith Zantow
2022-12-02 13:24:36 -05:00
committed by GitHub
parent 247b054ab5
commit 614ea00905
4 changed files with 17 additions and 5 deletions
+7
View File
@@ -91,6 +91,12 @@ func fileNameTemplateVersionMatcher(fileNamePattern string, contentTemplate stri
}
}
func patternEndingWithNull(pattern string) string {
bytes := []byte(pattern)
bytes = append(bytes, 0)
return string(bytes)
}
func fileContentsVersionMatcher(pattern string) evidenceMatcher {
pat := regexp.MustCompile(pattern)
return func(classifier classifier, reader source.LocationReadCloser) ([]pkg.Package, error) {
@@ -130,6 +136,7 @@ func singlePackage(classifier classifier, reader source.LocationReadCloser, vers
Locations: source.NewLocationSet(reader.Location),
Type: pkg.BinaryPkg,
CPEs: cpes,
FoundBy: catalogerName,
MetadataType: pkg.BinaryMetadataType,
Metadata: pkg.BinaryMetadata{
Classifier: classifier.Class,