]> The Tcpdump Group git mirrors - libpcap/commitdiff
rpcapd: make a shift count unsigned.
authorGuy Harris <[email protected]>
Wed, 24 Feb 2021 02:49:46 +0000 (18:49 -0800)
committerGuy Harris <[email protected]>
Thu, 25 Feb 2021 18:59:52 +0000 (10:59 -0800)
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)

rpcapd/daemon.c

index 620dec313d4befe85f9253f2d8a41b0329d05baf..3bcc7337ff824636ec0812f0fe0192178b10a1c1 100644 (file)
@@ -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)