Skip to content
Snippets Groups Projects
Commit 62be394b authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

subsdec: Fix potential out of bound read


Reported-by: default avatarYannay Livneh <yannayl@checkpoint.com>
             Omri Herscovici <omrih@checkpoint.com>
             Omer Gull <omergu@checkpoint.com>
parent 40c9a623
No related branches found
No related tags found
No related merge requests found
......@@ -512,6 +512,8 @@ static char* ConsumeAttribute( const char** ppsz_subtitle, char** psz_attribute_
// Skip over to the attribute value
while ( *psz_subtitle && *psz_subtitle != '=' )
psz_subtitle++;
if ( !*psz_subtitle )
return psz_attribute_name;
// Skip the '=' sign
psz_subtitle++;
......@@ -539,6 +541,8 @@ static char* ConsumeAttribute( const char** ppsz_subtitle, char** psz_attribute_
psz_subtitle++;
attr_len++;
}
if ( attr_len == 0 )
return psz_attribute_name;
if ( unlikely( !( *psz_attribute_value = malloc( attr_len + 1 ) ) ) )
{
free( psz_attribute_name );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment