coverity fixes - fixed string copy
This commit is contained in:
parent
c563c03fb1
commit
8871709170
3 changed files with 4 additions and 1 deletions
|
@ -573,6 +573,7 @@ channel_get_icon ( channel_t *ch )
|
|||
|
||||
} else {
|
||||
strncpy(buf, icon, sizeof(buf));
|
||||
buf[sizeof(buf)-1] = '\0';
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
|
|
@ -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] != ' ')
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue