shithub: freetype+ttf2subf

Download patch

ref: 11d65e8a1f1f14e56148fd991965424d9bd1cdbc
parent: fe3433c7368cb9b237fc35c247254d6e8cc12bb5
author: Suzuki, Toshiya (鈴木俊哉) <[email protected]>
date: Wed Aug 4 10:43:29 EDT 2010

[cff] Improve stack overflow test.

* src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack
after execution of operations too.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-08-04  Suzuki, Toshiya (鈴木俊哉) <[email protected]>
+
+	[cff] Improve stack overflow test.
+
+	* src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack
+	after execution of operations too.
+
 2010-07-18  Werner Lemberg  <[email protected]>
 
 	Add reference counters and to FT_Library and FT_Face objects.
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2455,7 +2455,10 @@
           return CFF_Err_Unimplemented_Feature;
         }
 
-      decoder->top = args;
+        decoder->top = args;
+
+        if ( decoder->top - stack >= CFF_MAX_OPERANDS )
+          goto Stack_Overflow;
 
       } /* general operator processing */