summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2014-11-26 22:54:49 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-11-26 23:03:32 (GMT)
commita4a1b37be0ff96492d13e87ce59c82482d961f56 (patch)
treeb022be86ddd11b1e2f42e4c7e07fd8a48ea8597b
parentb7fc2eb15aa02da234e9fd2f4ab021bfff6c00c2 (diff)
downloadmonitoring-plugins-a4a1b37be0ff96492d13e87ce59c82482d961f56.tar.gz
check_ntp: fix null termination
Fix null termination introduced by commit a04df3e ("plugins/check_ntp.c - Verify struct from response"). Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
-rw-r--r--plugins/check_ntp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 09a923e..546802a 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -616,7 +616,7 @@ double jitter_request(const char *host, int *status){
616 if (bytes_read != ntp_cm_ints + req.count) 616 if (bytes_read != ntp_cm_ints + req.count)
617 die(STATE_UNKNOWN, _("Invalid NTP response: %d bytes read does not equal %d plus %d data segment"), bytes_read, ntp_cm_ints, req.count); 617 die(STATE_UNKNOWN, _("Invalid NTP response: %d bytes read does not equal %d plus %d data segment"), bytes_read, ntp_cm_ints, req.count);
618 /* else null terminate */ 618 /* else null terminate */
619 strncpy(req.data[req.count], "\0", 1); 619 req.data[req.count] = '\0';
620 620
621 DBG(print_ntp_control_message(&req)); 621 DBG(print_ntp_control_message(&req));
622 622