Commit 2b790c3e authored by Harry Sintonen's avatar Harry Sintonen Committed by Jean-Baptiste Kempf

Handle early termination properly in StripTags

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f62e6d6e
...@@ -640,6 +640,9 @@ static char *StripTags( char *psz_subtitle ) ...@@ -640,6 +640,9 @@ static char *StripTags( char *psz_subtitle )
*psz_text++ = *psz_subtitle; *psz_text++ = *psz_subtitle;
} }
/* Security fix: Account for the case where input ends early */
if( *psz_subtitle == '\0' ) break;
psz_subtitle++; psz_subtitle++;
} }
*psz_text = '\0'; *psz_text = '\0';
......
...@@ -1072,6 +1072,9 @@ static char *StripTags( char *psz_subtitle ) ...@@ -1072,6 +1072,9 @@ static char *StripTags( char *psz_subtitle )
*psz_text++ = *psz_subtitle; *psz_text++ = *psz_subtitle;
} }
/* Security fix: Account for the case where input ends early */
if( *psz_subtitle == '\0' ) break;
psz_subtitle++; psz_subtitle++;
} }
*psz_text = '\0'; *psz_text = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment