From: Guy Harris Date: Wed, 24 Feb 2021 02:49:46 +0000 (-0800) Subject: rpcapd: make a shift count unsigned. X-Git-Tag: libpcap-1.10.1~79 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/7a623bc8e98f693fea9c9f8e700e604c20dc8627 rpcapd: make a shift count unsigned. That should prevent compilers and, more important, static analyzers (I'm looking at *you*, Coverity!) from saying "this converts the unsigned char to an int, which somehow taints it, so I get to use my favorite meaningless word "tainted" in a warning". (What does "tainted" mean to Coverity, anyway? ZOMG UR READING NUMBERZ FROM AN EXTERNAL SOURCE!!!!!!!!1111ONE!!!!!!!!!?) (cherry picked from commit b1f9b176115eae9235ac4fd48aa0da9c61f46e67) --- diff --git a/rpcapd/daemon.c b/rpcapd/daemon.c index 620dec31..3bcc7337 100644 --- a/rpcapd/daemon.c +++ b/rpcapd/daemon.c @@ -375,7 +375,7 @@ daemon_serviceloop(SOCKET sockctrl, int isactive, char *passiveClients, // Immediate EOF goto end; } - plen = (tls_header.length_hi << 8) | tls_header.length_lo; + plen = (tls_header.length_hi << 8U) | tls_header.length_lo; // Discard the rest of the message. if (rpcapd_discard(sockctrl, NULL, plen) == -1)