Browse Source

main.c: fix another potential buffer overflow in strncat() call

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf 11 years ago
parent
commit
2d8fec839c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main.c

+ 1 - 1
src/main.c

@@ -504,7 +504,7 @@ static void set_absolute_path(char *options[], const char *option_name,
             path[sizeof(path)-1] = 0;
         }
 
-        strncat(path, "/", sizeof(path) - 1);
+        strncat(path, "/", sizeof(path) - strlen(path) - 1);
         strncat(path, option_value, sizeof(path) - strlen(path) - 1);
 
         /* Absolutize the path, and set the option */