]> The Tcpdump Group git mirrors - tcpdump/commitdiff
CFM: There must be at least one byte of MA short name.
authorGuy Harris <[email protected]>
Wed, 15 Feb 2017 23:01:02 +0000 (15:01 -0800)
committerDenis Ovsienko <[email protected]>
Wed, 13 Sep 2017 11:25:44 +0000 (12:25 +0100)
This should fix Coverity CID 1400555.

print-cfm.c

index 09199fa580ae9973eb1d3c269c6801c834f85dbb..450922a5cd0a14ed296e26a2d63f282f69e6a2fb 100644 (file)
@@ -368,8 +368,11 @@ cfm_print(netdissect_options *ndo,
                    md_nameformat,
                    md_namelength));
 
-            /* -2 for the MA short name format and length */
-            if (md_namelength > names_data_remaining - 2) {
+            /*
+             * -3 for the MA short name format and length and one byte
+             * of MA short name.
+             */
+            if (md_namelength > names_data_remaining - 3) {
                 ND_PRINT((ndo, " (too large, must be <= %u)", names_data_remaining - 2));
                 return;
             }