]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Babel: Avoid an unsigned integer underflow
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 8 Mar 2019 12:34:39 +0000 (13:34 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 9 Mar 2019 20:20:40 +0000 (21:20 +0100)
print-babel.c

index fb70a7fc51abf925de7e9060abd9459c9d794abd..70310d702036a625865a7ba0229cc36fd26fbdd1 100644 (file)
@@ -301,10 +301,11 @@ subtlvs_print(netdissect_options *ndo,
                 break;
             }
             sep = " ";
-            while(sublen--) {
+            while (sublen) {
                 ND_PRINT("%s%s", sep, tok2str(diversity_str, "%u", EXTRACT_U_1(cp)));
                 cp++;
                 sep = "-";
+                sublen--;
             }
             if(tlv_type != MESSAGE_UPDATE &&
                tlv_type != MESSAGE_UPDATE_SRC_SPECIFIC)