freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master db4083f: * src/sfnt/sfwoff2.c (woff2_open_font): Chec


From: Werner LEMBERG
Subject: [freetype2] master db4083f: * src/sfnt/sfwoff2.c (woff2_open_font): Check (sum of) table sizes.
Date: Wed, 25 Sep 2019 02:48:55 -0400 (EDT)

branch: master
commit db4083fd7f19fd3fbd5d5a8e60d5c8e0f19778bd
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    * src/sfnt/sfwoff2.c (woff2_open_font): Check (sum of) table sizes.
    
    Reported as
    
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17684
---
 ChangeLog          | 8 ++++++++
 src/sfnt/sfwoff2.c | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index fd20d92..16a5568 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-09-25  Werner Lemberg  <address@hidden>
+
+       * src/sfnt/sfwoff2.c (woff2_open_font): Check (sum of) table sizes.
+
+       Reported as
+
+         https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17684
+
 2019-09-23  Alexei Podtelezhnikov  <address@hidden>
 
        * src/base/ftstroke.c (ft_stroke_border_arcto): Speed up calculations.
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index bb7c981..7d90179 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -2161,6 +2161,13 @@
       goto Exit;
     }
 
+    if ( woff2.uncompressed_size > sfnt_size )
+    {
+      FT_ERROR(( "woff2_open_font: SFNT table lengths are too large.\n" ));
+      error = FT_THROW( Invalid_Table );
+      goto Exit;
+    }
+
     /* Allocate memory for uncompressed table data. */
     if ( FT_ALLOC( uncompressed_buf, woff2.uncompressed_size ) ||
          FT_FRAME_ENTER( woff2.totalCompressedSize )           )



reply via email to

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