From 99ea3eaf5b071b31cb7eaf0770593a57ad0214ab Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 4 Dec 2017 10:59:53 +0100 Subject: 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 --- pkg/report/linux.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/report/linux.go') 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 } -- cgit mrf-deployment