summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Harl <sh@teamix.net>2011-04-28 07:18:21 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2011-04-29 00:42:53 (GMT)
commit5ebe25fc24d33cf2d7b46fce9e746a58e0115010 (patch)
tree25b36b76141d4253d56e58c158a1e6c1c32573ee
parent1bc7a4a198aefde2389c9c1685baed0da7856bf5 (diff)
downloadmonitoring-plugins-5ebe25fc24d33cf2d7b46fce9e746a58e0115010.tar.gz
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 <max@tcen.ru> for reporting this in Debian bug #623702.
-rw-r--r--NEWS1
-rw-r--r--THANKS.in1
-rw-r--r--plugins-root/check_icmp.c2
3 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index fcaa9c1..8bb0fcb 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ This file documents the major additions and syntax changes between releases.
14 Make check_snmp work more like v1.4.14 with regard to using special values (Timeticks, STRING) as numeric thresholds 14 Make check_snmp work more like v1.4.14 with regard to using special values (Timeticks, STRING) as numeric thresholds
15 Fix check_ldap overriding the port when --ssl was specified after -p 15 Fix check_ldap overriding the port when --ssl was specified after -p
16 Fix check_procs where regex input of '|' would get displayed in output - now replaced with ',' 16 Fix check_procs where regex input of '|' would get displayed in output - now replaced with ','
17 Fix segfault in check_host when hostname returns multiple IP addresses (Sebastian Harl)
17 18
181.4.15 27th July 2010 191.4.15 27th July 2010
19 ENHANCEMENTS 20 ENHANCEMENTS
diff --git a/THANKS.in b/THANKS.in
index cb8d26c..c6775bc 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -268,3 +268,4 @@ Brian Landers
268Ryan Kelly 268Ryan Kelly
269Stéphane Urbanovski 269Stéphane Urbanovski
270Marco Beck 270Marco Beck
271Sebastian Harl
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 6d8ba09..fe8fc56 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -621,7 +621,7 @@ main(int argc, char **argv)
621 } 621 }
622 622
623 host = list; 623 host = list;
624 table = malloc(sizeof(struct rta_host **) * (argc - 1)); 624 table = malloc(sizeof(struct rta_host **) * targets);
625 i = 0; 625 i = 0;
626 while(host) { 626 while(host) {
627 host->id = i*packets; 627 host->id = i*packets;