diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-05-14 01:52:54 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-05-14 01:52:54 -0700 |
commit | db3f9f277f4283318a760791dac2bed9507b4793 (patch) | |
tree | b2e2f9de6a1d6a2abfed6c6f254ca60a738aeadd /addrtoname.h | |
parent | 6daf3a543ec058d04e78018d0639b0a7c7494bfa (diff) | |
download | tcpdump-db3f9f277f4283318a760791dac2bed9507b4793.tar.gz |
Make the hex-dumping routines for addresses take a uint8_t * argument.
Hopefully, that will convince Coverity that the result of dereferencing
those pointers will have a value between 0x00 and 0xff, and therefore
that shifting that result right by 4 bits will yield a value between 0x0
and 0xf, and therefore that this result can safely be used as an index
into the 16-element hex[] array.
I guess Coverity wants us to realize that there really *are* C
implementations out there with non-8-bit char and unsigned char values,
even though getting tcpdump to work on them will probably be a highly
entertaining exercise (not to mention that the only one I know of that's
actually being *used* are the Unisys Clearpath Dorado series, and
they're one's complement, which is yet *another* place where the port
could be entertaining...).
Diffstat (limited to 'addrtoname.h')
-rw-r--r-- | addrtoname.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addrtoname.h b/addrtoname.h index a127b4e8..97b72000 100644 --- a/addrtoname.h +++ b/addrtoname.h @@ -39,12 +39,12 @@ enum { #define BUFSIZE 128 -extern const char *linkaddr_string(netdissect_options *, const u_char *, const unsigned int, const unsigned int); -extern const char *etheraddr_string(netdissect_options *, const u_char *); -extern const char *le64addr_string(netdissect_options *, const u_char *); +extern const char *linkaddr_string(netdissect_options *, const uint8_t *, const unsigned int, const unsigned int); +extern const char *etheraddr_string(netdissect_options *, const uint8_t *); +extern const char *le64addr_string(netdissect_options *, const uint8_t *); extern const char *tcpport_string(netdissect_options *, u_short); extern const char *udpport_string(netdissect_options *, u_short); -extern const char *isonsap_string(netdissect_options *, const u_char *, u_int); +extern const char *isonsap_string(netdissect_options *, const uint8_t *, u_int); extern const char *dnaddr_string(netdissect_options *, u_short); extern const char *ipxsap_string(netdissect_options *, u_short); extern const char *ipaddr_string(netdissect_options *, const u_char *); |