Skip to content

Commit 175e41d

Browse files
gasbytesdanielinux
authored andcommitted
add missing cast when validating tcp header length that they actually
fits in the ip payload
1 parent 0f0ab68 commit 175e41d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wolfip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ static void tcp_input(struct wolfIP *S, unsigned int if_idx, struct wolfIP_tcp_s
20002000
return;
20012001
}
20022002
/* Validate TCP header length fits in IP payload */
2003-
if (iplen < IP_HEADER_LEN + (tcp->hlen >> 2)) {
2003+
if (iplen < (uint32_t)(IP_HEADER_LEN + (tcp->hlen >> 2))) {
20042004
return; /* malformed: TCP header exceeds IP length */
20052005
}
20062006
tcplen = iplen - (IP_HEADER_LEN + (tcp->hlen >> 2));

0 commit comments

Comments
 (0)