mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
SSL: Fix ref/unref problem.
VectorType unref'd the Record type we used during construction, apparently leading to it not being present anymore at some point of time. Fix this problem by doing it just like all other analyzers.
This commit is contained in:
parent
1ba33bf66e
commit
8d9cd60fa8
1 changed files with 2 additions and 6 deletions
|
@ -104,17 +104,13 @@ refine connection Handshake_Conn += {
|
||||||
|
|
||||||
function proc_signature_algorithm(rec: HandshakeRecord, supported_signature_algorithms: SignatureAndHashAlgorithm[]) : bool
|
function proc_signature_algorithm(rec: HandshakeRecord, supported_signature_algorithms: SignatureAndHashAlgorithm[]) : bool
|
||||||
%{
|
%{
|
||||||
RecordType* rt = BifType::Record::SSL::SignatureAndHashAlgorithm;
|
VectorVal* slist = new VectorVal(internal_type("signature_and_hashalgorithm_vec")->AsVectorType());
|
||||||
VectorType* vt = new VectorType(rt);
|
|
||||||
|
|
||||||
VectorVal* slist = new VectorVal(vt);
|
|
||||||
Unref(vt); // not consumed, VectorVal refs.
|
|
||||||
|
|
||||||
if ( supported_signature_algorithms )
|
if ( supported_signature_algorithms )
|
||||||
{
|
{
|
||||||
for ( unsigned int i = 0; i < supported_signature_algorithms->size(); ++i )
|
for ( unsigned int i = 0; i < supported_signature_algorithms->size(); ++i )
|
||||||
{
|
{
|
||||||
RecordVal* el = new RecordVal(rt);
|
RecordVal* el = new RecordVal(BifType::Record::SSL::SignatureAndHashAlgorithm);
|
||||||
el->Assign(0, new Val((*supported_signature_algorithms)[i]->HashAlgorithm(), TYPE_COUNT));
|
el->Assign(0, new Val((*supported_signature_algorithms)[i]->HashAlgorithm(), TYPE_COUNT));
|
||||||
el->Assign(1, new Val((*supported_signature_algorithms)[i]->SignatureAlgorithm(), TYPE_COUNT));
|
el->Assign(1, new Val((*supported_signature_algorithms)[i]->SignatureAlgorithm(), TYPE_COUNT));
|
||||||
slist->Assign(i, el);
|
slist->Assign(i, el);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue