From: Jaroslav Kysela Date: Fri, 3 Oct 2014 14:58:39 +0000 (+0200) Subject: settings: coverity - possible buf overflow X-Git-Tag: v4.1~1181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc1d444ed923b05005c033b165b97a0b96cf1108;p=thirdparty%2Ftvheadend.git settings: coverity - possible buf overflow --- diff --git a/src/utils.c b/src/utils.c index 9c252a4bd..3212e93ef 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]) {