diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2022-05-09 10:38:26 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2022-05-09 11:10:52 +0200 |
| commit | 8b277b8e2ac2f385eec24532a4786cc4ad12e9ae (patch) | |
| tree | 8dd5eb972a618a3e2412605dc5fb85a058236880 /pkg/instance/instance.go | |
| parent | e60b110364688cf334ec68e073edf8d9cebc9fcb (diff) | |
pkg/instance: fix nil derefs in patch testing and bisections
Fix these crashes:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xd430ae]
goroutine 875 [running]:
github.com/google/syzkaller/pkg/instance.(*inst).testRepro.func1(...)
pkg/instance/instance.go:371
github.com/google/syzkaller/pkg/instance.(*inst).testRepro(0xc0005a2c80)
pkg/instance/instance.go:396 +0x26e
github.com/google/syzkaller/pkg/instance.(*inst).test(0xc0005a2c80)
pkg/instance/instance.go:293 +0xf2
github.com/google/syzkaller/pkg/instance.(*env).Test.func1()
pkg/instance/instance.go:237 +0x26
created by github.com/google/syzkaller/pkg/instance.(*env).Test
pkg/instance/instance.go:237 +0x1d7
syz-ci.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Diffstat (limited to 'pkg/instance/instance.go')
| -rw-r--r-- | pkg/instance/instance.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 218408191..f5e84b8eb 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -368,10 +368,13 @@ func (inst *inst) testRepro() error { return err } transformError := func(res *RunResult, err error) error { - if err != nil && res.Report != nil { + if err != nil { + return err + } + if res != nil && res.Report != nil { return &CrashError{Report: res.Report} } - return err + return nil } if len(inst.reproSyz) > 0 { var opts csource.Options |
