mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Use signed value for tcp header offset and option lengths to detect underflow
This commit is contained in:
2
tcpip.cc
2
tcpip.cc
@@ -1352,7 +1352,7 @@ int readudppacket(const u8 *packet, int readdata) {
|
|||||||
The options checked are MSS, WScale, SackOK, Sack, and Timestamp. */
|
The options checked are MSS, WScale, SackOK, Sack, and Timestamp. */
|
||||||
static bool validateTCPhdr(const u8 *tcpc, unsigned len) {
|
static bool validateTCPhdr(const u8 *tcpc, unsigned len) {
|
||||||
struct tcp_hdr *tcp = (struct tcp_hdr *) tcpc;
|
struct tcp_hdr *tcp = (struct tcp_hdr *) tcpc;
|
||||||
unsigned hdrlen, optlen;
|
int hdrlen, optlen;
|
||||||
|
|
||||||
hdrlen = tcp->th_off * 4;
|
hdrlen = tcp->th_off * 4;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user