- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed a bug reporting that a vulnerability exists in the wrong package. #409
Fixed a bug reporting that a vulnerability exists in the wrong package. #409
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments. Please fix it.
scan/redhat.go
Outdated
line = o.regexpReplace(line, `^\*\*\sNo\sChangeLog\sfor:.*`, "") | ||
lines = append(lines, line) | ||
if yumChangelogFirstPattern.MatchString(line) { | ||
line = o.regexpReplace(line, `^ChangeLog for: `, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use stirngs.TrimPrefix
scan/redhat.go
Outdated
line = o.regexpReplace(line, `^ChangeLog for: `, "") | ||
line = o.regexpReplace(line, `^\*\*\sNo\sChangeLog\sfor:.*`, "") | ||
lines = append(lines, line) | ||
if yumChangelogFirstPattern.MatchString(line) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Strings.HasPrefix
scan/redhat.go
Outdated
lines = append(lines, line) | ||
if yumChangelogFirstPattern.MatchString(line) { | ||
line = o.regexpReplace(line, `^ChangeLog for: `, "") | ||
if yumChangelogLastPattern.MatchString(line) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use strings.HasSuffix
scan/redhat.go
Outdated
lines = append(lines, line) | ||
} | ||
} else if yumChangelogNextPattern.MatchString(line) { | ||
line = o.regexpReplace(line, `^ {13}: `, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use strings.TrimPrefix
scan/redhat.go
Outdated
} else { | ||
lines = append(lines, line) | ||
} | ||
} else if yumChangelogNextPattern.MatchString(line) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use strings.HasPrefix
scan/redhat.go
Outdated
} | ||
} else if yumChangelogNextPattern.MatchString(line) { | ||
line = o.regexpReplace(line, `^ {13}: `, "") | ||
if yumChangelogLastPattern.MatchString(line) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use strings.HasSuffix
tmpline = "" | ||
} | ||
} else { | ||
line = o.regexpReplace(line, `^\*\*\sNo\sChangeLog\sfor:.*`, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please Use strings.HasPrefix
This issue will be fixed in #449 |
The output format of yum has changed.
What did you implement:
Closes #408
How did you implement it:
I made it possible to deal with even if the package name was divided into multiple lines.
How can we verify it:
./vuls tui
Todos:
You don't have to satisfy all of the following.
make fmt
make test
Is this ready for review?: YES
Is it a breaking change?: NO