Просмотр исходного кода

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>
Sebastian Herbszt 11 лет назад
Родитель
Сommit
dd2d423853
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      plugins/check_ntp.c

+ 1 - 1
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));