1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Use signed value for tcp header offset and option lengths to detect underflow

This commit is contained in:
dmiller
2020-09-09 21:34:55 +00:00
parent b8c8fe8047
commit 3521f15180

View File

@@ -1352,7 +1352,7 @@ int readudppacket(const u8 *packet, int readdata) {
The options checked are MSS, WScale, SackOK, Sack, and Timestamp. */
static bool validateTCPhdr(const u8 *tcpc, unsigned len) {
struct tcp_hdr *tcp = (struct tcp_hdr *) tcpc;
unsigned hdrlen, optlen;
int hdrlen, optlen;
hdrlen = tcp->th_off * 4;