[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 8bb7722a5: [gzip] Handle inflate returning Z_NEED_DIC

From: Werner Lemberg
Subject: [freetype2] master 8bb7722a5: [gzip] Handle inflate returning Z_NEED_DICT
Date: Tue, 14 Jun 2022 01:01:01 -0400 (EDT)

branch: master
commit 8bb7722a5315fe9f176821242fd453fadb3004da
Author: Ben Wagner <>
Commit: Ben Wagner <>

    [gzip] Handle inflate returning Z_NEED_DICT
    When `inflate` returns `Z_NEED_DICT` this is currently not reported as
    an error and callers may assume that the decompression succeeded when it
    did not. In particular, a compressed table in a woff file may not
    actually be decompressed and written as expected, leaving the backing
    memory for the expanded table uninitialized.
    * src/gzlip/ftgzip.c (FT_Gzip_Uncompress): treat `Z_NEED_DICT` as
    indicating invalid data since there is no means to provide a dictionary.
 src/gzip/ftgzip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c
index 34bbe4daf..915182e1f 100644
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -790,6 +790,9 @@
     if ( err == Z_DATA_ERROR )
       return FT_THROW( Invalid_Table );
+    if ( err == Z_NEED_DICT )
+      return FT_THROW( Invalid_Table );
     return FT_Err_Ok;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]