rpms/freetype-freeworld/devel freetype-2.4.6-CVE-2011-3256.patch, NONE, 1.1 freetype-freeworld.spec, 1.18, 1.19

Kevin Kofler kkofler at rpmfusion.org
Sun Oct 23 02:02:53 CEST 2011


Author: kkofler

Update of /cvs/free/rpms/freetype-freeworld/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv25609/devel

Modified Files:
	freetype-freeworld.spec 
Added Files:
	freetype-2.4.6-CVE-2011-3256.patch 
Log Message:
* Sun Oct 23 2011 Kevin Kofler <Kevin at tigcc.ticalc.org> 2.4.6-2
- Add freetype-2.4.6-CVE-2011-3256.patch from Fedora freetype
    (Handle some border cases)

freetype-2.4.6-CVE-2011-3256.patch:
 base/ftbitmap.c    |    6 +++++-
 psaux/t1decode.c   |    7 +++++++
 raster/ftrend1.c   |   10 +++++++++-
 truetype/ttgxvar.c |    5 ++++-
 4 files changed, 25 insertions(+), 3 deletions(-)

--- NEW FILE freetype-2.4.6-CVE-2011-3256.patch ---
--- freetype-2.4.6/src/base/ftbitmap.c	2011-06-14 23:02:56.000000000 +0200
+++ freetype-2.4.6/src/base/ftbitmap.c	2011-10-20 17:14:17.000000000 +0200
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType utility functions for bitmaps (body).                       */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007, 2008, 2009 by                        */
+/*  Copyright 2004-2009, 2011 by                                           */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -417,6 +417,10 @@
 
         target->pitch = source->width + pad;
 
+        if ( target->pitch > 0                           &&
+             target->rows > FT_ULONG_MAX / target->pitch )
+          return FT_Err_Invalid_Argument;
+
         if ( target->rows * target->pitch > old_size             &&
              FT_QREALLOC( target->buffer,
                           old_size, target->rows * target->pitch ) )
--- freetype-2.4.6/src/psaux/t1decode.c	2011-07-22 05:19:45.000000000 +0200
+++ freetype-2.4.6/src/psaux/t1decode.c	2011-10-20 17:14:17.000000000 +0200
@@ -764,6 +764,13 @@
             if ( arg_cnt != 0 )
               goto Unexpected_OtherSubr;
 
+            if ( decoder->flex_state == 0 )
+            {
+              FT_ERROR(( "t1_decoder_parse_charstrings:"
+                         " missing flex start\n" ));
+              goto Syntax_Error;
+            }
+
             /* note that we should not add a point for index 0; */
             /* this will move our current position to the flex  */
             /* point without adding any point to the outline    */
--- freetype-2.4.6/src/raster/ftrend1.c	2011-01-15 07:46:16.000000000 +0100
+++ freetype-2.4.6/src/raster/ftrend1.c	2011-10-20 17:14:37.000000000 +0200
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType glyph rasterizer interface (body).                      */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2005, 2006 by                         */
+/*  Copyright 1996-2003, 2005, 2006, 2011 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -25,6 +25,7 @@
 
 #include "rasterrs.h"
 
+#define FT_USHORT_MAX  USHRT_MAX
 
   /* initialize renderer -- init its raster */
   static FT_Error
@@ -176,6 +177,13 @@
 
     width  = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
     height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
+
+    if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )
+    {
+      error = Raster_Err_Invalid_Argument;
+      goto Exit;
+    }
+
     bitmap = &slot->bitmap;
     memory = render->root.memory;
 
--- freetype-2.4.6/src/truetype/ttgxvar.c	2011-06-14 23:02:57.000000000 +0200
+++ freetype-2.4.6/src/truetype/ttgxvar.c	2011-10-20 17:14:17.000000000 +0200
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType GX Font Variation loader                                    */
 /*                                                                         */
-/*  Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010 by                  */
+/*  Copyright 2004-2011 by                                                 */
 /*  David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.     */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -1474,6 +1474,9 @@
       {
         for ( j = 0; j < point_count; ++j )
         {
+          if ( localpoints[j] >= n_points )
+            continue;
+
           delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply );
           delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply );
         }


Index: freetype-freeworld.spec
===================================================================
RCS file: /cvs/free/rpms/freetype-freeworld/devel/freetype-freeworld.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- freetype-freeworld.spec	4 Aug 2011 16:36:51 -0000	1.18
+++ freetype-freeworld.spec	23 Oct 2011 00:02:53 -0000	1.19
@@ -1,7 +1,7 @@
 Summary: A free and portable font rendering engine
 Name: freetype-freeworld
 Version: 2.4.6
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: FTL or GPLv2+
 Group: System Environment/Libraries
 URL: http://www.freetype.org
@@ -14,6 +14,7 @@
 
 # Security patches
 Patch89:  freetype-2.4.2-CVE-2010-3311.patch
+Patch90:  freetype-2.4.6-CVE-2011-3256.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
 
@@ -43,6 +44,7 @@
 %patch46  -p1 -b .enable-valid
 
 %patch89 -p1 -b .CVE-2010-3311
+%patch90 -p1 -b .CVE-2011-3256
 
 %build
 
@@ -87,6 +89,10 @@
 %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
 
 %changelog
+* Sun Oct 23 2011 Kevin Kofler <Kevin at tigcc.ticalc.org> 2.4.6-2
+- Add freetype-2.4.6-CVE-2011-3256.patch from Fedora freetype
+    (Handle some border cases)
+
 * Thu Aug 04 2011 Kevin Kofler <Kevin at tigcc.ticalc.org> 2.4.6-1
 - Update to 2.4.6 (matches Fedora freetype)
 - Drop freetype-2.4.5-CVE-2011-0226.patch (fixed upstream)



More information about the rpmfusion-commits mailing list