diff options
author | Sebastian Herbszt <herbszt@gmx.de> | 2014-11-26 23:54:49 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-11-27 00:03:32 +0100 |
commit | a4a1b37be0ff96492d13e87ce59c82482d961f56 (patch) | |
tree | b022be86ddd11b1e2f42e4c7e07fd8a48ea8597b | |
parent | b7fc2eb15aa02da234e9fd2f4ab021bfff6c00c2 (diff) | |
download | monitoring-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 09a923eb..546802a3 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 | ||