diff options
| author | practicalswift <[email protected]> | 2017-11-10 15:22:54 +0100 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2017-11-10 15:37:37 +0100 |
| commit | 63c2d83e58c7506a1030e7fe4dcea84cdce97147 (patch) | |
| tree | 677047ac759c3a07d737cdd8195f8ee87ebc03d0 /src/test/scriptnum_tests.cpp | |
| parent | Merge #11646: Require a steady clock for bench with at least micro precision (diff) | |
| download | discoin-63c2d83e58c7506a1030e7fe4dcea84cdce97147.tar.xz discoin-63c2d83e58c7506a1030e7fe4dcea84cdce97147.zip | |
Explicitly state assumption that state.m_chain_sync.m_work_header != nullptr in ConsiderEviction
Static analyzer (and humans!) will see ...
```
else if (state.m_chain_sync.m_timeout == 0 || (state.m_chain_sync.m_work_header != nullptr && ...
```
... and infer that state.m_chain_sync.m_work_header might be set to nullptr,
and thus flag `state.m_chain_sync.m_work_header->GetBlockHash().ToString()`
as a potential null pointer dereference.
This commit makes the tacit assumption (m_work_header != nullptr) explicit.
Code introduced in 5a6d00 ("Permit disconnection of outbound peers on
bad/slow chains") which was merged into master four days ago.
Diffstat (limited to 'src/test/scriptnum_tests.cpp')
0 files changed, 0 insertions, 0 deletions