forked from minhngoc25a/freetype2
* builds/mac/ftmac.c (parse_fond): Fix buffer overrun.
Reported as bug #54515, duplicate of #43540.
This commit is contained in:
parent
33cd1eedcf
commit
c94162a220
|
@ -1,3 +1,9 @@
|
||||||
|
2018-08-16 Young Xiao <yangx92@hotmail.com>
|
||||||
|
|
||||||
|
* builds/mac/ftmac.c (parse_fond): Fix buffer overrun.
|
||||||
|
|
||||||
|
Reported as bug #54515, duplicate of #43540.
|
||||||
|
|
||||||
2018-08-16 Werner Lemberg <wl@gnu.org>
|
2018-08-16 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* builds/*/ftsystem.c (FT_COMPONENT): Updated also.
|
* builds/*/ftsystem.c (FT_COMPONENT): Updated also.
|
||||||
|
|
|
@ -780,9 +780,10 @@ typedef short ResourceIndex;
|
||||||
style = (StyleTable*)p;
|
style = (StyleTable*)p;
|
||||||
p += sizeof ( StyleTable );
|
p += sizeof ( StyleTable );
|
||||||
string_count = EndianS16_BtoN( *(short*)(p) );
|
string_count = EndianS16_BtoN( *(short*)(p) );
|
||||||
|
string_count = FT_MIN( 64, string_count );
|
||||||
p += sizeof ( short );
|
p += sizeof ( short );
|
||||||
|
|
||||||
for ( i = 0; i < string_count && i < 64; i++ )
|
for ( i = 0; i < string_count; i++ )
|
||||||
{
|
{
|
||||||
names[i] = p;
|
names[i] = p;
|
||||||
p += names[i][0];
|
p += names[i][0];
|
||||||
|
@ -799,7 +800,7 @@ typedef short ResourceIndex;
|
||||||
ps_name[ps_name_len] = 0;
|
ps_name[ps_name_len] = 0;
|
||||||
}
|
}
|
||||||
if ( style->indexes[face_index] > 1 &&
|
if ( style->indexes[face_index] > 1 &&
|
||||||
style->indexes[face_index] <= FT_MIN( string_count, 64 ) )
|
style->indexes[face_index] <= string_count )
|
||||||
{
|
{
|
||||||
unsigned char* suffixes = names[style->indexes[face_index] - 1];
|
unsigned char* suffixes = names[style->indexes[face_index] - 1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue