[vlc-commits] input: fix check for unnamed attachment, potential read overflow

Rémi Denis-Courmont git at videolan.org
Sat Aug 15 12:24:01 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 15 13:19:39 2015 +0300| [12c11c31d9e791060f541eb5ca42c20f4c130ceb] | committer: Rémi Denis-Courmont

input: fix check for unnamed attachment, potential read overflow

Pointed-out-by: <hugh1234 at mail.ustc.edu.cn>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=12c11c31d9e791060f541eb5ca42c20f4c130ceb
---

 src/input/input.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/input.c b/src/input/input.c
index 3efda10..a84be6e 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1004,7 +1004,7 @@ static void LoadSubtitles( input_thread_t *p_input )
         if( !a )
             continue;
         char *psz_mrl;
-        if( a->psz_name[i] &&
+        if( a->psz_name[0] &&
             asprintf( &psz_mrl, "attachment://%s", a->psz_name ) >= 0 )
         {
             var_SetString( p_input, "sub-description", a->psz_description ? a->psz_description : "");



More information about the vlc-commits mailing list