Skip to content

Commit

Permalink
subsdec: Fix potential out of bound read
Browse files Browse the repository at this point in the history
Reported-by: Yannay Livneh <yannayl@checkpoint.com>
             Omri Herscovici <omrih@checkpoint.com>
             Omer Gull <omergu@checkpoint.com>
  • Loading branch information
chouquette committed Apr 7, 2017
1 parent 40c9a62 commit 62be394
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/codec/subsdec.c
Expand Up @@ -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++;

Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 62be394

Please sign in to comment.