mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Avoid a null dereference (Coverity-1402816)
This commit is contained in:
parent
69023a0c75
commit
1af2640f4b
1 changed files with 3 additions and 0 deletions
|
@ -179,6 +179,9 @@ std::unique_ptr<CounterVector> CounterVector::Unserialize(const broker::data& da
|
|||
auto width = caf::get_if<uint64>(&(*v)[0]);
|
||||
auto bits = BitVector::Unserialize((*v)[1]);
|
||||
|
||||
if ( ! (width && bits) )
|
||||
return nullptr;
|
||||
|
||||
auto cv = std::unique_ptr<CounterVector>(new CounterVector());
|
||||
cv->width = *width;
|
||||
cv->bits = bits.release();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue