[PATCH] check_ntp: fix null termination

Sebastian Herbszt <[email protected]>
Newsgroups gmane.network.nagios.devel
Message-ID <20141126235449.00006b6f__39232.043879065$1417042935$gmane$org@localhost>
Fix null termination introduced by commit a04df3e ("plugins/check_ntp.c - Verify struct from response").

Signed-off-by: Sebastian Herbszt <[email protected]>
---
 plugins/check_ntp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index fb4450c..7488fa5 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -616,7 +616,7 @@ double jitter_request(const char *host, int *status){
 				if (bytes_read != ntp_cm_ints + req.count)
 					die(STATE_UNKNOWN, _("Invalid NTP response: %d bytes read does not equal %d plus %d data segment"), bytes_read, ntp_cm_ints, req.count); 
 				/* else null terminate */
-				strncpy(req.data[req.count], "\0", 1);
+				req.data[req.count] = '\0';
 
 				DBG(print_ntp_control_message(&req));
 
-- 
2.1.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.