]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Loopback: Fix the uses of the pointer to the end of current packet
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 1 Mar 2018 15:08:24 +0000 (16:08 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 1 Mar 2018 15:40:04 +0000 (16:40 +0100)
Must be based on packet header caplen.

print-loopback.c

index e0c6efbdfc295a100aa75d0d836b4f0a256b0cf7..46942c94d7190a73ee00ec9c78b5b0cef9e2e6ba 100644 (file)
@@ -56,7 +56,7 @@ static const struct tok fcode_str[] = {
 static void
 loopback_message_print(netdissect_options *ndo, const u_char *cp, const u_int len)
 {
-       const u_char *ep = cp + len;
+       const u_char *ep = ndo->ndo_snapend;
        uint16_t function;
 
        if (len < 2)
@@ -107,7 +107,7 @@ trunc:
 void
 loopback_print(netdissect_options *ndo, const u_char *cp, const u_int len)
 {
-       const u_char *ep = cp + len;
+       const u_char *ep = ndo->ndo_snapend;
        uint16_t skipCount;
 
        ND_PRINT("Loopback");