fix a buffer overflow causing a segfault

(original patch by Vladimir Voroshilov < voroshil _at_ univer.omsk.su >)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18764 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
aurel 2006-06-20 11:48:39 +00:00
parent 05a3579b3c
commit 95db10787d
1 changed files with 2 additions and 1 deletions

View File

@ -331,7 +331,8 @@ static int open_tv(tvi_handle_t *tvh)
if (!sep) continue; // Wrong syntax, but mplayer should not crash
strcpy(tv_channel_current->name, sep + 1);
strlcpy(tv_channel_current->name, sep + 1,
sizeof(tv_channel_current->name));
sep[0] = '\0';
strncpy(tv_channel_current->number, tmp, 5);