aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2017-07-27 14:15:08 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-07-27 14:48:21 +0200
commitbbd1f3487bac60b9539f8ddfdba2c4fc0874fb50 (patch)
treeb83411bacf50165f7b729072f9c79b4ac8a752d0 /pkg
parent240fb175d9a4dc4ff79dfefa60c51096be302e4a (diff)
pkg/repro: fix null-ptr-deref when res is nil
res can become nil if one of the repro routines fails with an error.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/repro/repro.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go
index 44555e9a8..13a1c5dc2 100644
--- a/pkg/repro/repro.go
+++ b/pkg/repro/repro.go
@@ -180,7 +180,9 @@ func (ctx *context) repro(entries []*prog.LogEntry, crashStart int) (*Result, er
return nil, nil
}
defer func() {
- res.Opts.Repro = false
+ if res != nil {
+ res.Opts.Repro = false
+ }
}()
res, err = ctx.minimizeProg(res)
if err != nil {