freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [gzip] Handle inflate returning Z_NEED_


From: Ben Wagner (@bungeman)
Subject: [Git][freetype/freetype][master] [gzip] Handle inflate returning Z_NEED_DICT
Date: Tue, 14 Jun 2022 05:00:53 +0000

Ben Wagner pushed to branch master at FreeType / FreeType

Commits:

  • 8bb7722a
    by Ben Wagner at 2022-06-14T04:49:29+00:00
    [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.
    
    Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1335712
    

1 changed file:

Changes:

  • src/gzip/ftgzip.c
    ... ... @@ -790,6 +790,9 @@
    790 790
         if ( err == Z_DATA_ERROR )
    
    791 791
           return FT_THROW( Invalid_Table );
    
    792 792
     
    
    793
    +    if ( err == Z_NEED_DICT )
    
    794
    +      return FT_THROW( Invalid_Table );
    
    795
    +
    
    793 796
         return FT_Err_Ok;
    
    794 797
       }
    
    795 798
     
    


  • reply via email to

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