]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dns (tcp) - fix coverity cid 1374307
authorJason Ish <ish@unx.ca>
Mon, 16 Jan 2017 16:31:01 +0000 (10:31 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 17 Jan 2017 09:39:24 +0000 (10:39 +0100)
CID 1374307 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking dns_state suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.
317    if (dns_state != NULL && f != NULL) {
318        dns_state->last_resp = f->lastts;
319    }

src/app-layer-dns-udp.c

index 6a2523454d3bfd4472a2114cfea26d0f2bac5b76..d8ee37d30f34e418860ff93104da374997dc34d7 100644 (file)
@@ -314,7 +314,7 @@ static int DNSUDPResponseParse(Flow *f, void *dstate,
 
         tx->replied = 1;
     }
-    if (dns_state != NULL && f != NULL) {
+    if (f != NULL) {
         dns_state->last_resp = f->lastts;
     }
     SCReturnInt(1);