]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
settings: coverity - possible buf overflow
authorJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 14:58:39 +0000 (16:58 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 14:58:39 +0000 (16:58 +0200)
src/utils.c

index 9c252a4bdafd92ea9550d74e4259038bd4219f71..3212e93efdfb0f46b19c50bb5daee6fbb7aa60e5 100644 (file)
@@ -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]) {