diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-09-27 12:50:25 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-09-27 12:50:25 +0200 |
| commit | 98b28ead6ceaf22064b9715cc1950848d2bdef0b (patch) | |
| tree | 067aea7eda2c79e553351917fe1d48f814f9326e /pkg/report/linux.go | |
| parent | 58fca249ef46c67eeb8e5f495bd3c289d19974f8 (diff) | |
pkg/report: fix few fuzz bugs
Improve go-fuzz fuzzer function and fix few new bugs it finds:
1. Panic in linux parser (bad).
2. Akaros can report empty rep.Report.
3. Fuchsia can return empty rep.Report.
Diffstat (limited to 'pkg/report/linux.go')
| -rw-r--r-- | pkg/report/linux.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 1880298b6..97d5e84c3 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -156,6 +156,7 @@ func (ctx *linux) Parse(output []byte) *Report { rep.Report = append(rep.Report, prefix...) rep.Report = append(rep.Report, '\n') } + rep.reportPrefixLen = len(rep.Report) rep.Report = append(rep.Report, report...) if !rep.Corrupted { rep.Corrupted, rep.CorruptedReason = ctx.isCorrupted(title, report, format) @@ -377,7 +378,7 @@ func symbolizeLine(symbFunc func(bin string, pc uint64) ([]symbolizer.Frame, err } func (ctx *linux) extractGuiltyFile(rep *Report) string { - report := rep.Report[rep.StartPos:] + report := rep.Report[rep.reportPrefixLen:] if linuxRcuStall.Match(report) { // Special case for rcu stalls. // There are too many frames that we want to skip before actual guilty frames, |
