Skip to content

Commit

Permalink
ext/featurefmt/dpkg: handle malformed packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Apr 11, 2017
1 parent 8227165 commit 590e7e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/featurefmt/dpkg/dpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ func (l lister) ListFeatures(files tarutil.FilesMap) ([]database.FeatureVersion,
} else {
pkg.Version = version
}
} else if line == "" {
pkg.Feature.Name = ""
pkg.Version = ""
}

// Add the package to the result array if we have all the informations
Expand Down
2 changes: 2 additions & 0 deletions ext/featurefmt/dpkg/testdata/status
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ This package is not necessary for most modern Linux systems, where the udev
subsystem provides a more dynamic mechanism for device file management.
Original-Maintainer: Debian QA Group <packages@qa.debian.org>

Package: brokenPackageWithNoVersionThatShouldGetThrownOut

Package: libgcc1
Status: install ok installed
Priority: required
Expand Down

0 comments on commit 590e7e2

Please sign in to comment.