shithub: freetype+ttf2subf

Download patch

ref: 271b1e163310ba1df4df1cf30583eb7c8740482f
parent: 6654763f83d1fc4314e6ed0228b31fab6b517256
author: Werner Lemberg <[email protected]>
date: Mon Jan 19 18:31:56 EST 2004

* src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one
CR, LF, or CR/LF after `eexec'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-20  Werner Lemberg  <[email protected]>
+
+	* src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one
+	CR, LF, or CR/LF after `eexec'.
+
 2004-01-18  David Turner  <[email protected]>
 
         * src/sfnt/ttsbit.c: removed compiler warning
@@ -30,7 +35,6 @@
 
           introducing the new FT_ARRAY_COPY and FT_ARRAY_MOVE macros
           to make copying arrays easier
-
 
 2004-01-14  Werner Lemberg  <[email protected]>
 
--- a/src/type1/t1parse.c
+++ b/src/type1/t1parse.c
@@ -356,8 +356,22 @@
       parser->root.limit = parser->base_dict + parser->base_len;
 
       T1_Skip_PS_Token( parser );
-      T1_Skip_Spaces  ( parser );
       cur = parser->root.cursor;
+      if ( *cur == '\r' )
+      {
+        cur++;
+        if ( *cur == '\n' )
+          cur++;
+      }
+      else if ( *cur == '\n' )
+        cur++;
+      else
+      {
+        FT_ERROR(( "T1_Get_Private_Dict:" ));
+        FT_ERROR(( " `eexec' not properly terminated\n" ));
+        error = T1_Err_Invalid_File_Format;
+        goto Exit;
+      }
 
       size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) );