diff options
author | Guy Harris <gharris@sonic.net> | 2021-01-05 18:01:26 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-01-05 18:08:50 -0800 |
commit | f853e73acf39658125ce42861e49ce4a181611d3 (patch) | |
tree | 726d5d178648599e9abb246f7554eb08f1444b83 /print-domain.c | |
parent | 6e816702d95742b18cbeb38a65958e531e48240a (diff) | |
download | tcpdump-f853e73acf39658125ce42861e49ce4a181611d3.tar.gz |
Replace ND_TCHECK_/memcpy() pairs with GET_CPY_BYTES().
For BGP, this eliminates some cases where routines return -1 on
truncation; clean up after that.
This also means that some memcpy()s get replaced by UNALIGNED_MEMCPY(),
which may fix some issues on processors that don't support unaligned
accesses.
Diffstat (limited to 'print-domain.c')
-rw-r--r-- | print-domain.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/print-domain.c b/print-domain.c index 74c71dba..c3c6fd8f 100644 --- a/print-domain.c +++ b/print-domain.c @@ -796,10 +796,8 @@ ns_rprint(netdissect_options *ndo, ND_PRINT(" %u(bad plen)", pbit); break; } else if (pbit < 128) { - if (!ND_TTEST_LEN(cp + 1, sizeof(a) - pbyte)) - return(NULL); memset(a, 0, sizeof(a)); - memcpy(a + pbyte, cp + 1, sizeof(a) - pbyte); + GET_CPY_BYTES(a + pbyte, cp + 1, sizeof(a) - pbyte); ND_PRINT(" %u %s", pbit, addrtostr6(&a, ntop_buf, sizeof(ntop_buf))); } |