From 95db10787dabb893ea6ad93fa0de5d072a3b91c2 Mon Sep 17 00:00:00 2001 From: aurel Date: Tue, 20 Jun 2006 11:48:39 +0000 Subject: [PATCH] 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 --- libmpdemux/tv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c index 3939ab11f5..7433d86337 100644 --- a/libmpdemux/tv.c +++ b/libmpdemux/tv.c @@ -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);