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

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


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

Handle early termination properly in StripTags

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 2b790c3e8cbc3dfb7e8709027b7bea358c6f18ba)

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

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

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

diff --git a/modules/codec/subtitles/subsdec.c b/modules/codec/subtitles/subsdec.c
index 5c55a6e..bfdbb13 100644
--- a/modules/codec/subtitles/subsdec.c
+++ b/modules/codec/subtitles/subsdec.c
@@ -632,6 +632,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/subtitles/subsusf.c b/modules/codec/subtitles/subsusf.c
index 5754137..fc1cf07 100644
--- a/modules/codec/subtitles/subsusf.c
+++ b/modules/codec/subtitles/subsusf.c
@@ -1081,6 +1081,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