aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report/linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-12-04 10:59:53 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-12-04 10:59:53 +0100
commit99ea3eaf5b071b31cb7eaf0770593a57ad0214ab (patch)
tree9721f2bc92313b402e41cafccc8a72513adbec74 /pkg/report/linux.go
parentc92879679c05ddf4364d1cd5dea947407f35b2f8 (diff)
pkg/report: test that Report is never empty
If Parse detects a crash, it must provide something in the Report field. If Report is empty, something is wrong with parsing. Update #457
Diffstat (limited to 'pkg/report/linux.go')
-rw-r--r--pkg/report/linux.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go
index 56d21cf5b..cb51b0c15 100644
--- a/pkg/report/linux.go
+++ b/pkg/report/linux.go
@@ -176,6 +176,10 @@ func (ctx *linux) Parse(output []byte) *Report {
rep.Title = funcRe.ReplaceAllString(rep.Title, "$1")
// CPU numbers are not interesting.
rep.Title = cpuRe.ReplaceAllLiteralString(rep.Title, "CPU")
+ // TODO: broken: https://github.com/google/syzkaller/issues/457
+ if len(rep.Report) == 0 {
+ rep.Report = []byte("NO REPORT")
+ }
return rep
}