From 2d8fec839c97b6e7f59821b285685fe474348cdb Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 13 May 2014 16:45:22 +0200 Subject: [PATCH] main.c: fix another potential buffer overflow in strncat() call Signed-off-by: Danny Al-Gaaf --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 28c5043c..1a1dfe06 100644 --- a/src/main.c +++ b/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 */