소스 검색

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 년 전
부모
커밋
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));