Skip to content

Commit 72095a1

Browse files
committed
IP: Update a length check
This should silence an erroneous 'ineffective_check' warning (Coverity CID 1619168).
1 parent 02bdfdc commit 72095a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

print-ip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ ip_print(netdissect_options *ndo,
414414
else
415415
ND_PRINT(", length %u", GET_BE_U_2(ip->ip_len));
416416

417-
if ((hlen - sizeof(struct ip)) > 0) {
417+
if ((hlen > sizeof(struct ip))) {
418418
ND_PRINT(", options (");
419419
if (ip_optprint(ndo, (const u_char *)(ip + 1),
420420
hlen - sizeof(struct ip)) == -1) {

0 commit comments

Comments
 (0)