소스 검색

Merge pull request #876 from pponnuvel/fix_strncpy_overflow

Fix a potential buffer overflow in unit test
bel2125 5 년 전
부모
커밋
ff1995d471
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      unittest/shared.c

+ 1 - 1
unittest/shared.c

@@ -44,5 +44,5 @@ set_test_directory(const char *const path)
 {
 	strncpy(s_test_directory,
 	        path,
-	        sizeof(s_test_directory) / sizeof(s_test_directory[0]));
+	        sizeof(s_test_directory) - 1);
 }