]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Sanity Checking added to addrtoname
authorBill Parker <[email protected]>
Tue, 4 Sep 2012 17:02:21 +0000 (10:02 -0700)
committerMichael Richardson <[email protected]>
Wed, 5 Sep 2012 00:45:02 +0000 (20:45 -0400)
Added return value checking for tp->e_bs against NULL to see if memory
was actually allocated :)

Conflicts:
addrtoname.c

addrtoname.c

index 350cd5e5d30a0e63fce877ff84d2f9d5cdd1d8bb..c92870dc324a68c0a7a5cb6937ea7f5169b760ce 100644 (file)
@@ -381,7 +381,7 @@ lookup_bytestring(register const u_char *bs, const unsigned int nlen)
        tp->e_addr2 = k;
 
        tp->e_bs = (u_char *) calloc(1, nlen + 1);
-       if (tp->e_nxt == NULL)
+       if (tp->e_bs == NULL)
                error("lookup_bytestring: calloc");
 
        memcpy(tp->e_bs, bs, nlen);