1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 21:59:02 +00:00

Fix a stupid bug I introduced: Use MAX and not MIN to give a minimum

size to the allocation of space for the --data-length.
This commit is contained in:
david
2009-08-24 20:47:28 +00:00
parent 986ba5ab8c
commit 41d053a1ed

View File

@@ -903,7 +903,7 @@ int nmap_main(int argc, char *argv[]) {
fatal("data-length must be between 0 and %d", MAX_PAYLOAD_ALLOWED);
if (o.extra_payload_length > 1400 ) /* 1500 - IP with opts - TCP with opts. */
error("WARNING: Payloads bigger than 1400 bytes may not be sent successfully.");
o.extra_payload = (char *) safe_malloc(MIN(o.extra_payload_length, 1));
o.extra_payload = (char *) safe_malloc(MAX(o.extra_payload_length, 1));
get_random_bytes(o.extra_payload, o.extra_payload_length);
} else if (optcmp(long_options[option_index].name, "send-eth") == 0) {
o.sendpref = PACKET_SEND_ETH_STRONG;