]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
coverity fixes - fixed string copy
authorJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 20:06:37 +0000 (22:06 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 20:06:37 +0000 (22:06 +0200)
src/channels.c
src/epggrab/module/xmltv.c
src/wrappers.c

index a8357f67f6c7eeecbbe3a0d04224c01a6a4a7702..3f60a6584882d61f998857a62611d4729561c4c2 100644 (file)
@@ -573,6 +573,7 @@ channel_get_icon ( channel_t *ch )
 
   } else {
     strncpy(buf, icon, sizeof(buf));
+    buf[sizeof(buf)-1] = '\0';
   }
 
   return buf;
index d2cbe7161fcf6e399d7dd849a770536922f6d33c..8b1836ba3a1dcc9ac4619994f32079727903e513 100755 (executable)
@@ -67,7 +67,8 @@ static time_t _xmltv_str2time(const char *in)
   char str[32];
 
   memset(&tm, 0, sizeof(tm));
-  strcpy(str, in);
+  strncpy(str, in, sizeof(str));
+  str[sizeof(str)-1] = '\0';
 
   /* split tz */
   while (str[sp] && str[sp] != ' ')
index 41c28c9fbea5237ac60ad47f856b8f32268077d0..4bf3fa064305ca411677a7c7f960e12772466c39 100644 (file)
@@ -136,6 +136,7 @@ tvhthread_create0
   int r;
   struct thread_state *ts = calloc(1, sizeof(struct thread_state));
   strncpy(ts->name, name, sizeof(ts->name));
+  ts->name[sizeof(ts->name)-1] = '\0';
   ts->run  = start_routine;
   ts->arg  = arg;
   r = pthread_create(thread, attr, thread_wrapper, ts);