[bzip2] Avoid use of uninitialized memory.
* src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Don't use `FT_QNEW` but `FT_NEW` for setting up `zip` to avoid uninitialized memory access while handling malformed PCF fonts later on. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42800
This commit is contained in:
parent
ca01112894
commit
d276bcb7f0
|
@ -481,7 +481,9 @@
|
||||||
FT_ZERO( stream );
|
FT_ZERO( stream );
|
||||||
stream->memory = memory;
|
stream->memory = memory;
|
||||||
|
|
||||||
if ( !FT_QNEW( zip ) )
|
/* Don't use `FT_QNEW` here to avoid problems with uninitialized */
|
||||||
|
/* memory later on if the font is malformed. */
|
||||||
|
if ( !FT_NEW( zip ) )
|
||||||
{
|
{
|
||||||
error = ft_bzip2_file_init( zip, stream, source );
|
error = ft_bzip2_file_init( zip, stream, source );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
|
Loading…
Reference in New Issue