]> The Tcpdump Group git mirrors - tcpdump/commitdiff
VTP: Avoid a pointer overflow
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 13 Jul 2019 11:22:06 +0000 (13:22 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 30 Jul 2019 19:24:33 +0000 (21:24 +0200)
Could be seen with 32 bits build.

print-vtp.c

index e2b1f9ff927d29e5ddc8e44d9fe4e3f51382841f..16eea5c9d8c396f706247236da39ff5f2b4c772a 100644 (file)
@@ -242,7 +242,7 @@ vtp_print(netdissect_options *ndo,
         */
 
        tptr += 4;
-       while (tptr < (pptr+length)) {
+       while ((unsigned)(tptr - pptr) < length) {
 
            ND_TCHECK_1(tptr);
            len = GET_U_1(tptr);