]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dns (tcp) - fix coverity CIDs 1374306, 1374305
authorJason Ish <ish@unx.ca>
Mon, 16 Jan 2017 16:34:19 +0000 (10:34 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 17 Jan 2017 09:39:24 +0000 (10:39 +0100)
CID 1374306 (#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.
585    if (dns_state != NULL && f != NULL) {
586        dns_state->last_req = f->lastts;
587    }

CID 1374305 (#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.
366    if (dns_state != NULL && f != NULL) {
367        dns_state->last_req = f->lastts;
368    }

src/app-layer-dns-tcp.c

index b27d8d87e9a964b6580233f0d8f954d39fa07280..4296a49c15f51bcaf4c29cbf75e31a342f16e8e7 100644 (file)
@@ -363,7 +363,7 @@ next_record:
             goto bad_data;
     }
 
-    if (dns_state != NULL && f != NULL) {
+    if (f != NULL) {
         dns_state->last_req = f->lastts;
     }
 
@@ -582,7 +582,7 @@ next_record:
             goto bad_data;
     }
 
-    if (dns_state != NULL && f != NULL) {
+    if (f != NULL) {
         dns_state->last_req = f->lastts;
     }