monitoring-plugins/plugins-root
Holger Weiss f732906649 check_icmp: Reject negative ICMP data length
The -b/--size handler checks the lower bound after casting the value to
unsigned long while checking the upper bound as a signed comparison.  A
negative argument such as "-b -65536" therefore satisfies both checks.
The value is then truncated to an undersized icmp_data_size, which later
serves as the size of the ICMP send buffer, so building the packet
overflows that buffer.

Compare the size as a signed long against both bounds so negative values
are rejected.

Reported-by: Christopher Kreft <Email@ChristopherKreft.de>
2026-06-30 16:20:12 +02:00
..
check_dhcp.d Refactor check_dhcp 2025-06-23 12:09:58 +02:00
check_icmp.d More refactoring 2025-09-15 15:49:26 +02:00
t Reapply "check_dhcp: reduce number of tests for weird reasons" 2025-06-23 13:21:25 +02:00
check_dhcp.c Run clang-format again 2025-09-15 12:59:37 +02:00
check_icmp.c check_icmp: Reject negative ICMP data length 2026-06-30 16:20:12 +02:00
Makefile.am Add check_dhcp related files to Makefile 2025-06-23 13:02:41 +02:00
pst3.c Run clang-format again 2025-09-15 12:59:37 +02:00