From 5ebe25fc24d33cf2d7b46fce9e746a58e0115010 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 28 Apr 2011 09:18:21 +0200 Subject: check_host: Allocate a large-enough buffer for the host table. When specifying a host-name on the command line, each of its IPs is added to the host table (and each one is pinged). So, the buffer has to be large enough to hold all of the respective host objects. (argc - 1) only fits hosts with a single IP. Thanks to Max Kosmach for reporting this in Debian bug #623702. --- plugins-root/check_icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins-root/check_icmp.c') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 6d8ba099..fe8fc56f 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -621,7 +621,7 @@ main(int argc, char **argv) } host = list; - table = malloc(sizeof(struct rta_host **) * (argc - 1)); + table = malloc(sizeof(struct rta_host **) * targets); i = 0; while(host) { host->id = i*packets; -- cgit v1.2.3