mirror of https://github.com/OISF/suricata
dns: fix coverity warning
** CID 1372324: Null pointer dereferences (FORWARD_NULL)
/src/output-json-dns.c: 532 in OutputAnswer()
________________________________________________________________________________________________________
*** CID 1372324: Null pointer dereferences (FORWARD_NULL)
/src/output-json-dns.c: 532 in OutputAnswer()
526 }
527 }
528
529 /* reset */
530 MemBufferReset(aft->buffer);
531 json_object_set_new(djs, "dns", js);
>>> CID 1372324: Null pointer dereferences (FORWARD_NULL)
>>> Dereferencing null pointer "entry".
532 if (likely(DNSRRTypeEnabled(entry->type, aft->dnslog_ctx->flags))) {
533 OutputJSONBuffer(djs, aft->dnslog_ctx->file_ctx, &aft->buffer);
534 }
535 json_object_del(djs, "dns");
536
537 return;
Move checks to the top of the functions. Should be more efficient too.
pull/2225/head
parent
b4565004c7
commit
bbcc22d2ad
Loading…
Reference in New Issue