rpms/fontconfig/devel fontconfig-2.3.95-fix-page-size-overflow.patch, NONE, 1.1 fontconfig.spec, 1.85, 1.86 fontconfig-2.3.95-maybe-fix-overflow.patch, 1.3, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Aug 11 17:35:46 UTC 2006


Author: rstrode

Update of /cvs/dist/rpms/fontconfig/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv15176

Modified Files:
	fontconfig.spec 
Added Files:
	fontconfig-2.3.95-fix-page-size-overflow.patch 
Removed Files:
	fontconfig-2.3.95-maybe-fix-overflow.patch 
Log Message:
- use "%5x" instead of " %4x" to support 64k instead of
  clamping.  Idea from Behdad.


fontconfig-2.3.95-fix-page-size-overflow.patch:
 fccache.c |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

--- NEW FILE fontconfig-2.3.95-fix-page-size-overflow.patch ---
--- fontconfig-2.3.95/src/fccache.c.fix-page-size-overflow	2006-08-11 13:34:08.000000000 -0400
+++ fontconfig-2.3.95/src/fccache.c	2006-08-11 13:34:08.000000000 -0400
@@ -39,6 +39,7 @@
 #define MACHINE_SIGNATURE_SIZE (9 + 5*20 + 1)
 /* for when we don't have sysconf: */
 #define FC_HARDCODED_PAGESIZE 8192 
+#define FC_MAX_PAGESIZE 0xfffff
 
 #ifndef O_BINARY
 #define O_BINARY 0
@@ -1536,10 +1537,28 @@
     static char buf[MACHINE_SIGNATURE_SIZE];
     int32_t magic = ENDIAN_TEST;
     char * m = (char *)&magic;
+    long page_size;
 
-    sprintf (buf, "%2x%2x%2x%2x "
+#if defined (HAVE_SYSCONF)
+    page_size = sysconf(_SC_PAGESIZE);
+#else
+    page_size = -1;
+#endif
+
+    if (page_size < 0)
+	    page_size = FC_HARDCODED_PAGESIZE;
+
+    if (page_size > FC_MAX_PAGESIZE)
+    {
+	    page_size = FC_MAX_PAGESIZE;
+	    fprintf (stderr, "system page size is bigger than expected\n");
+    }
+
+    snprintf (buf, 
+	      sizeof (buf),
+	     "%2x%2x%2x%2x "
 	     "%4x %4x %4x %4x %4x %4x %4x %4x %4x %4x %4x %4x "
-	     "%4x %4x %4x %4x %4x %4x %4x %4x\n", 
+	     "%4x %4x %4x %4x %4x %4x %4x%5x\n", 
 	     m[0], m[1], m[2], m[3],
 	     (unsigned int)sizeof (char),
 	     (unsigned int)sizeof (char *),
@@ -1560,11 +1579,7 @@
 	     (unsigned int)sizeof (FcCharLeaf),
 	     (unsigned int)sizeof (FcChar32),
 	     (unsigned int)sizeof (FcCache),
-#if defined (HAVE_SYSCONF)
-	     (unsigned int)sysconf(_SC_PAGESIZE));
-#else
-	     (unsigned int)FC_HARDCODED_PAGESIZE);
-#endif
+	     (unsigned int)page_size);
 
     return buf;
 }


Index: fontconfig.spec
===================================================================
RCS file: /cvs/dist/rpms/fontconfig/devel/fontconfig.spec,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- fontconfig.spec	11 Aug 2006 16:38:58 -0000	1.85
+++ fontconfig.spec	11 Aug 2006 17:35:44 -0000	1.86
@@ -3,7 +3,7 @@
 Summary: Font configuration and customization library
 Name: fontconfig
 Version: 2.3.95
-Release: 9%{?dist}
+Release: 10%{?dist}
 License: MIT
 Group: System Environment/Libraries
 Source: http://fontconfig.org/release/fontconfig-%{version}.tar.gz
@@ -17,7 +17,7 @@
 Patch3: fontconfig-2.4-cmap-parsing.patch
 Patch4: fontconfig-2.3.95-ttf-collections.patch
 Patch5: fontconfig-2.3.95-fd-leak.patch
-Patch6: fontconfig-2.3.95-maybe-fix-overflow.patch
+Patch6: fontconfig-2.3.95-fix-page-size-overflow.patch
 
 BuildRequires: freetype-devel >= %{freetype_version}
 BuildRequires: expat-devel
@@ -58,7 +58,7 @@
 %patch3 -p1 -b .cmap-parsing
 %patch4 -p1 -b .ttf-collections
 %patch5 -p1 -b .fd-leak
-%patch6 -p1 -b .maybe-fix-overflow
+%patch6 -p1 -b .fix-page-size-overflow
 
 %build
 %configure --with-add-fonts=/usr/share/X11/fonts/Type1,/usr/share/X11/fonts/OTF
@@ -145,6 +145,10 @@
 %{_mandir}/man3/*
 
 %changelog
+* Fri Aug 11 2006 Ray Strode <rstrode at redhat.com> - 2.3.95-10
+- use "%5x" instead of " %4x" to support 64k instead of
+  clamping.  Idea from Behdad.
+
 * Fri Aug 11 2006 Ray Strode <rstrode at redhat.com> - 2.3.95-9
 - tweak last patch to give a more reasonable page size
   value if 64k page size is in effect.


--- fontconfig-2.3.95-maybe-fix-overflow.patch DELETED ---




More information about the fedora-cvs-commits mailing list