diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-03-25 16:19:48 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-03-25 15:50:51 +0000 |
| commit | bcd9b39fec6079d0458646b5a7c4fb7e5421c49e (patch) | |
| tree | 1edc398ac7955ee320543c861ddc6c3fc0b7f887 | |
| parent | 77a8ddb5b3e19ad8aaf44ceaabf2427cc1963cb5 (diff) | |
syz-fuzzer: avoid a nil ptr dereference
In case of a reproducible syz-executor failure, we could end up with
a nil ipc.ProgInfo object. Don't dereference it.
| -rw-r--r-- | syz-fuzzer/fuzzer.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/syz-fuzzer/fuzzer.go b/syz-fuzzer/fuzzer.go index d652a45bf..56b3321e5 100644 --- a/syz-fuzzer/fuzzer.go +++ b/syz-fuzzer/fuzzer.go @@ -382,17 +382,18 @@ func (tool *FuzzerTool) exchangeDataWorker() { } func (tool *FuzzerTool) convertExecutionResult(res executionResult) rpctype.ExecutionResult { - if res.NeedSignal == rpctype.NewSignal { - tool.diffMaxSignal(res.info) - } - if res.SignalFilter != nil { - // TODO: we can filter without maps if req.SignalFilter is sorted. - filterProgInfo(res.info, res.SignalFilter) - } - return rpctype.ExecutionResult{ - ID: res.ID, - Info: *res.info, + ret := rpctype.ExecutionResult{ID: res.ID} + if res.info != nil { + if res.NeedSignal == rpctype.NewSignal { + tool.diffMaxSignal(res.info) + } + if res.SignalFilter != nil { + // TODO: we can filter without maps if req.SignalFilter is sorted. + filterProgInfo(res.info, res.SignalFilter) + } + ret.Info = *res.info } + return ret } func (tool *FuzzerTool) grabStats() map[string]uint64 { |
