From 91f7daa9ed1030525da5e6749e86552d627d3abc Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 13 May 2014 16:43:28 +0200 Subject: [PATCH] main.c: fix strncat call to prevent buffer overflow 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 d09426e4..28c5043c 100644 --- a/src/main.c +++ b/src/main.c @@ -505,7 +505,7 @@ static void set_absolute_path(char *options[], const char *option_name, } strncat(path, "/", sizeof(path) - 1); - strncat(path, option_value, sizeof(path) - 1); + strncat(path, option_value, sizeof(path) - strlen(path) - 1); /* Absolutize the path, and set the option */ IGNORE_UNUSED_RESULT(abs_path(path, abs, sizeof(abs)));