Skip to content

Commit

Permalink
dns (tcp) - fix coverity CIDs 1374306, 1374305
Browse files Browse the repository at this point in the history
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    }
  • Loading branch information
jasonish authored and victorjulien committed Jan 17, 2017
1 parent dfbfb50 commit a10a922
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app-layer-dns-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static int DNSTCPRequestParse(Flow *f, void *dstate,
goto bad_data;
}

if (dns_state != NULL && f != NULL) {
if (f != NULL) {
dns_state->last_req = f->lastts;
}

Expand Down Expand Up @@ -582,7 +582,7 @@ static int DNSTCPResponseParse(Flow *f, void *dstate,
goto bad_data;
}

if (dns_state != NULL && f != NULL) {
if (f != NULL) {
dns_state->last_req = f->lastts;
}

Expand Down

0 comments on commit a10a922

Please sign in to comment.