]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
fix possible wrong strncpy() in tvhlog_thread(), fixes #5071
authorJaroslav Kysela <perex@perex.cz>
Thu, 12 Apr 2018 14:53:51 +0000 (16:53 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 12 Apr 2018 14:53:51 +0000 (16:53 +0200)
src/tvhlog.c

index ee5ed8f600562e2f64f8c061fd2a83f5c3e12eb1..71df76138778bf6ce1909177b2ba43f52f0fa4ad 100644 (file)
@@ -355,7 +355,8 @@ tvhlog_thread ( void *p )
     /* Copy options and path */
     if (!fp) {
       if (tvhlog_path) {
-        strncpy(buf, tvhlog_path, sizeof(buf));
+        strncpy(buf, tvhlog_path, sizeof(buf)-1);
+        buf[sizeof(buf)-1] = '\0';
         path = buf;
       } else {
         path = NULL;