diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-12-11 12:46:51 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2017-12-11 22:11:01 +0100 |
commit | 84ef17ac0eecb3efc11a63c3f2c578ae78732c02 (patch) | |
tree | c62632ddf7ae57a999a89938ecaf8e590bfcc019 /print-zeromq.c | |
parent | 264ed29aae3407c1a6816c64813806a077ccebcb (diff) | |
download | tcpdump-84ef17ac0eecb3efc11a63c3f2c578ae78732c02.tar.gz |
Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)
ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l)
ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
Diffstat (limited to 'print-zeromq.c')
-rw-r--r-- | print-zeromq.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/print-zeromq.c b/print-zeromq.c index b53745e5..e43d0717 100644 --- a/print-zeromq.c +++ b/print-zeromq.c @@ -89,13 +89,13 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) } else { header_len = 1 + 8; /* 0xFF, length */ ND_PRINT((ndo, " frame flags+body (64-bit) length")); - ND_TCHECK2(*cp, header_len); /* 0xFF, length */ + ND_TCHECK_LEN(cp, header_len); /* 0xFF, length */ body_len_declared = EXTRACT_BE_U_8(cp + 1); ND_PRINT((ndo, " %" PRIu64, body_len_declared)); } if (body_len_declared == 0) return cp + header_len; /* skip to the next frame */ - ND_TCHECK2(*cp, header_len + 1); /* ..., flags */ + ND_TCHECK_LEN(cp, header_len + 1); /* ..., flags */ flags = EXTRACT_U_1(cp + header_len); body_len_captured = ep - cp - header_len; @@ -127,12 +127,12 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) /* * Do not advance cp by the sum of header_len and body_len_declared - * before each offset has successfully passed ND_TCHECK2() as the + * before each offset has successfully passed ND_TCHECK_LEN() as the * sum can roll over (9 + 0xfffffffffffffff7 = 0) and cause an * infinite loop. */ cp += header_len; - ND_TCHECK2(*cp, body_len_declared); /* Next frame within the buffer ? */ + ND_TCHECK_LEN(cp, body_len_declared); /* Next frame within the buffer ? */ return cp + body_len_declared; trunc: |