Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
coverity fixes - fixed string copy
  • Loading branch information
perexg committed Oct 3, 2014
1 parent c563c03 commit 8871709
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/channels.c
Expand Up @@ -573,6 +573,7 @@ channel_get_icon ( channel_t *ch )

} else {
strncpy(buf, icon, sizeof(buf));
buf[sizeof(buf)-1] = '\0';
}

return buf;
Expand Down
3 changes: 2 additions & 1 deletion src/epggrab/module/xmltv.c
Expand Up @@ -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] != ' ')
Expand Down
1 change: 1 addition & 0 deletions src/wrappers.c
Expand Up @@ -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);
Expand Down

0 comments on commit 8871709

Please sign in to comment.