Browse Source

Merge pull request #876 from pponnuvel/fix_strncpy_overflow

Fix a potential buffer overflow in unit test
bel2125 5 years ago
parent
commit
ff1995d471
1 changed files with 1 additions and 1 deletions
  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);
 }