Skip to content

Commit

Permalink
Fix changelog cache bug when invalid changelog #235
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe committed Nov 1, 2016
1 parent 406efa9 commit cf9a963
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scan/debian.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,13 @@ func (o *debian) scanPackageCveIDs(pack models.PackageInfo) ([]string, error) {
o.log.Warnf("Failed to SSH: %s", r)
// Ignore this Error.
return nil, nil

}
err := cache.DB.PutChangelog(o.getServerInfo().GetServerName(), pack.Name, r.Stdout)
if err != nil {
return nil, fmt.Errorf("Failed to put changelog into cache")

if 0 < len(strings.TrimSpace(r.Stdout)) {
err := cache.DB.PutChangelog(o.getServerInfo().GetServerName(), pack.Name, r.Stdout)
if err != nil {
return nil, fmt.Errorf("Failed to put changelog into cache")
}
}
// No error will be returned. Only logging.
return o.getCveIDFromChangelog(r.Stdout, pack.Name, pack.Version), nil
Expand Down

0 comments on commit cf9a963

Please sign in to comment.