mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
Merge remote-tracking branch 'origin/topic/timw/coverity-fixes'
* origin/topic/timw/coverity-fixes: Fix a number of Coverity findings
This commit is contained in:
commit
6a5b51eba8
6 changed files with 24 additions and 8 deletions
9
CHANGES
9
CHANGES
|
@ -1,3 +1,12 @@
|
||||||
|
4.2.0-dev.393 | 2021-11-29 13:46:59 -0700
|
||||||
|
|
||||||
|
* Fix a number of Coverity findings (Tim Wojtulewicz, Corelight)
|
||||||
|
|
||||||
|
1466460: Uninitialized field in gtp-analyzer.pac
|
||||||
|
1462465: Null pointer dereference in CompositeHash::SingleValHash
|
||||||
|
1462463: Copy/paste error in TCPSessionAdapter::build_syn_packet_val
|
||||||
|
1462067: Uninitialized fields in Zinst
|
||||||
|
|
||||||
4.2.0-dev.391 | 2021-11-29 13:44:11 -0700
|
4.2.0-dev.391 | 2021-11-29 13:44:11 -0700
|
||||||
|
|
||||||
* suppress unneeded initializations (Vern Paxson, Corelight)
|
* suppress unneeded initializations (Vern Paxson, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
4.2.0-dev.391
|
4.2.0-dev.393
|
||||||
|
|
|
@ -501,6 +501,11 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// All of the rest of the code here depends on v not being null, since it needs
|
||||||
|
// to get values from it.
|
||||||
|
if ( ! v )
|
||||||
|
return false;
|
||||||
|
|
||||||
switch ( t )
|
switch ( t )
|
||||||
{
|
{
|
||||||
case TYPE_INTERNAL_INT:
|
case TYPE_INTERNAL_INT:
|
||||||
|
@ -695,7 +700,7 @@ bool CompositeHash::SingleValHash(HashKey& hk, const Val* v, Type* bt, bool type
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_INTERNAL_ERROR:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -610,7 +610,9 @@ connection GTPv1_Conn(zeek_analyzer: ZeekPacketAnalyzer)
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%init{
|
%init{
|
||||||
valid_orig = valid_resp = false;
|
valid_orig = false;
|
||||||
|
valid_resp = false;
|
||||||
|
packet = nullptr;
|
||||||
%}
|
%}
|
||||||
|
|
||||||
function valid(orig: bool): bool
|
function valid(orig: bool): bool
|
||||||
|
|
|
@ -422,7 +422,7 @@ static zeek::RecordValPtr build_syn_packet_val(bool is_orig, const zeek::IP_Hdr*
|
||||||
if ( TSval )
|
if ( TSval )
|
||||||
v->Assign(8, *TSval);
|
v->Assign(8, *TSval);
|
||||||
|
|
||||||
if ( TSval )
|
if ( TSecr )
|
||||||
v->Assign(9, *TSecr);
|
v->Assign(9, *TSecr);
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
|
|
|
@ -64,9 +64,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a stub instruction that will be populated later.
|
// Create a stub instruction that will be populated later.
|
||||||
ZInst() { }
|
ZInst() = default;
|
||||||
|
|
||||||
virtual ~ZInst() { }
|
virtual ~ZInst() = default;
|
||||||
|
|
||||||
// Methods for printing out the instruction for debugging/maintenance.
|
// Methods for printing out the instruction for debugging/maintenance.
|
||||||
void Dump(bro_uint_t inst_num, const FrameReMap* mappings) const;
|
void Dump(bro_uint_t inst_num, const FrameReMap* mappings) const;
|
||||||
|
@ -93,8 +93,8 @@ public:
|
||||||
// Returns a string describing the constant.
|
// Returns a string describing the constant.
|
||||||
std::string ConstDump() const;
|
std::string ConstDump() const;
|
||||||
|
|
||||||
ZOp op;
|
ZOp op = OP_NOP;
|
||||||
ZAMOpType op_type;
|
ZAMOpType op_type = OP_X;
|
||||||
|
|
||||||
// Usually indices into frame, though sometimes hold integer constants.
|
// Usually indices into frame, though sometimes hold integer constants.
|
||||||
// When an instruction has both frame slots and integer constants,
|
// When an instruction has both frame slots and integer constants,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue