]> The Tcpdump Group git mirrors - tcpdump/commitdiff
No need to check whether data is present if there isn't any data.
authorGuy Harris <[email protected]>
Mon, 25 Jun 2018 05:07:46 +0000 (22:07 -0700)
committerGuy Harris <[email protected]>
Mon, 25 Jun 2018 05:07:46 +0000 (22:07 -0700)
print-aoe.c

index c7c564bb3834cdcbe8440a38dad992adb51b0bf3..b9d0d71897e83561d0a82d5df127f3caa62f8865 100644 (file)
@@ -234,8 +234,8 @@ aoev1_query_print(netdissect_options *ndo,
        if (cslen > AOEV1_MAX_CONFSTR_LEN || AOEV1_QUERY_ARG_LEN + cslen > len)
                goto invalid;
        /* Config String */
        if (cslen > AOEV1_MAX_CONFSTR_LEN || AOEV1_QUERY_ARG_LEN + cslen > len)
                goto invalid;
        /* Config String */
-       ND_TCHECK_LEN(cp, cslen);
        if (cslen) {
        if (cslen) {
+               ND_TCHECK_LEN(cp, cslen);
                ND_PRINT("\n\tConfig String (length %u): ", cslen);
                if (nd_printn(ndo, cp, cslen, ndo->ndo_snapend))
                        goto trunc;
                ND_PRINT("\n\tConfig String (length %u): ", cslen);
                if (nd_printn(ndo, cp, cslen, ndo->ndo_snapend))
                        goto trunc;