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

Merge pull request #876 from pponnuvel/fix_strncpy_overflow

Fix a potential buffer overflow in unit test
bel2125 5 лет назад
Родитель
Сommit
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);
 }