]> The Tcpdump Group git mirrors - tcpdump/commit
Cast dport and sport to u_int before shifting them.
authorGuy Harris <[email protected]>
Thu, 24 May 2018 19:11:09 +0000 (12:11 -0700)
committerGuy Harris <[email protected]>
Mon, 15 Oct 2018 17:22:39 +0000 (10:22 -0700)
commit6f454b2bd29148bc439ca192cd886f2a6abd5ad4
tree7b7561823daf1ef71fb6174b567fcc35b925f88e
parent64759158259054a12011ada20cfff503883ed434
Cast dport and sport to u_int before shifting them.

The result of the expression is ultimately going to be put into a u_int;
cast them to u_int so that we'll be shifting unsigned values left rather
than int values, to avoid undefined behavior.

This should fix GitHub issue #681.

(cherry picked from commit cde392ab16d1de6b88f6b70dca6ddd4b83d8b525)
print-tcp.c