From bc1d444ed923b05005c033b165b97a0b96cf1108 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 3 Oct 2014 16:58:39 +0200 Subject: [PATCH] settings: coverity - possible buf overflow --- src/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 9c252a4b..3212e93e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -502,7 +502,8 @@ makedirs ( const char *inpath, int mode ) x = 1; ok = 1; - strcpy(path, inpath); + strncpy(path, inpath, sizeof(path)-1); + path[sizeof(path)-1] = '\0'; while(ok) { ok = path[x]; if (path[x] == '/' || !path[x]) {