From: Jaroslav Kysela Date: Thu, 12 Apr 2018 14:53:51 +0000 (+0200) Subject: fix possible wrong strncpy() in tvhlog_thread(), fixes #5071 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78081ea95adce7a765265924df7a5ee3323280f3;p=thirdparty%2Ftvheadend.git fix possible wrong strncpy() in tvhlog_thread(), fixes #5071 --- diff --git a/src/tvhlog.c b/src/tvhlog.c index ee5ed8f60..71df76138 100644 --- a/src/tvhlog.c +++ b/src/tvhlog.c @@ -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;