[vlc-commits] commit: Handle early termination properly in StripTags (Harry Sintonen )

git at videolan.org git at videolan.org
Mon Jan 17 00:09:02 CET 2011


vlc | branch: master | Harry Sintonen <sintonen at iki.fi> | Mon Jan 17 00:47:58 2011 +0200| [2b790c3e8cbc3dfb7e8709027b7bea358c6f18ba] | committer: Jean-Baptiste Kempf 

Handle early termination properly in StripTags

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/subsdec.c |    3 +++
 modules/codec/subsusf.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index 22c951e..d0beae8 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -640,6 +640,9 @@ static char *StripTags( char *psz_subtitle )
             *psz_text++ = *psz_subtitle;
         }
 
+        /* Security fix: Account for the case where input ends early */
+        if( *psz_subtitle == '\0' ) break;
+
         psz_subtitle++;
     }
     *psz_text = '\0';
diff --git a/modules/codec/subsusf.c b/modules/codec/subsusf.c
index c69c454..3886c52 100644
--- a/modules/codec/subsusf.c
+++ b/modules/codec/subsusf.c
@@ -1072,6 +1072,9 @@ static char *StripTags( char *psz_subtitle )
             *psz_text++ = *psz_subtitle;
         }
 
+        /* Security fix: Account for the case where input ends early */
+        if( *psz_subtitle == '\0' ) break;
+
         psz_subtitle++;
     }
     *psz_text = '\0';



More information about the vlc-commits mailing list