monitoring-plugins/plugins-root
Holger Weiss c35c12e58d check_icmp: Reject more than 65535 target hosts
The number of -H hosts is counted into an unsigned short, so supplying
more than 65535 hosts wraps the counter.  The subsequent calloc(3) then
allocates an undersized hosts array while the later parsing loop still
writes one entry per host, overflowing the heap buffer.  As
process_arguments() runs before we drop privileges via setuid(getuid()),
this happens while still running as root on setuid-root installs.

Guard both places where the counter is incremented and bail out with a
usage error once 65535 hosts are reached, rather than wrapping silently.

Reported-by: Christopher Kreft <Email@ChristopherKreft.de>
2026-06-30 15:32:40 +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 more than 65535 target hosts 2026-06-30 15:32:40 +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