PERFORCE change 166430 for review

Jonathan Anderson jona at FreeBSD.org
Thu Jul 23 05:37:43 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166430

Change 166430 by jona at jona-trustedbsd-belle-vmware on 2009/07/23 05:36:50

	mmap() can fail and return MAP_FAILED, not just NULL\!

Affected files ...

.. //depot/projects/trustedbsd/capabilities/qt-patches/x11-fonts/fontconfig/files/patch-bsd-capabilities.diff#2 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/qt-patches/x11-fonts/fontconfig/files/patch-bsd-capabilities.diff#2 (text+ko) ====

@@ -1,6 +1,6 @@
 diff -ruN src/Makefile.am src/Makefile.am
 --- src/Makefile.am	2008-05-04 04:19:42.000000000 +0100
-+++ src/Makefile.am	2009-07-12 21:00:06.000000000 +0100
++++ src/Makefile.am	2009-07-12 21:14:51.000000000 +0100
 @@ -75,7 +75,8 @@
  	$(EXPAT_CFLAGS)					\
  	$(WARN_CFLAGS)					\
@@ -13,7 +13,7 @@
  
 diff -ruN src/Makefile.in src/Makefile.in
 --- src/Makefile.in	2008-06-01 03:31:00.000000000 +0100
-+++ src/Makefile.in	2009-07-12 21:00:06.000000000 +0100
++++ src/Makefile.in	2009-07-12 21:14:51.000000000 +0100
 @@ -95,7 +95,7 @@
  	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  CCLD = $(CC)
@@ -35,7 +35,7 @@
  noinst_HEADERS = fcint.h fcftint.h fcdeprecate.h
 diff -ruN src/fccache.c src/fccache.c
 --- src/fccache.c	2007-11-14 00:36:41.000000000 +0000
-+++ src/fccache.c	2009-07-12 21:08:46.000000000 +0100
++++ src/fccache.c	2009-07-23 06:30:10.000000000 +0100
 @@ -37,6 +37,10 @@
  #  include <windows.h>
  #endif
@@ -75,6 +75,15 @@
      if (FcStat ((char *) dir, &dir_stat) < 0)
          return FcFalse;
  
+@@ -568,7 +586,7 @@
+ 	}
+ #endif
+     }
+-    if (!cache)
++    if (!cache || (cache == MAP_FAILED))
+     {
+ 	cache = malloc (fd_stat->st_size);
+ 	if (!cache)
 @@ -893,6 +911,12 @@
      if (!FcAtomicLock (atomic))
  	goto bail3;
@@ -90,7 +99,7 @@
  	goto bail4;
 diff -ruN src/fccfg.c src/fccfg.c
 --- src/fccfg.c	2008-05-25 00:14:15.000000000 +0100
-+++ src/fccfg.c	2009-07-12 21:08:41.000000000 +0100
++++ src/fccfg.c	2009-07-12 21:14:51.000000000 +0100
 @@ -36,6 +36,10 @@
  #define R_OK 4
  #endif
@@ -119,7 +128,7 @@
      
 diff -ruN src/fcdir.c src/fcdir.c
 --- src/fcdir.c	2007-10-16 05:55:59.000000000 +0100
-+++ src/fcdir.c	2009-07-12 21:07:26.000000000 +0100
++++ src/fcdir.c	2009-07-23 06:31:35.000000000 +0100
 @@ -22,6 +22,10 @@
   * PERFORMANCE OF THIS SOFTWARE.
   */
@@ -131,7 +140,7 @@
  #include "fcint.h"
  #include <dirent.h>
  
-@@ -30,8 +34,17 @@
+@@ -30,6 +34,14 @@
  {
      struct stat	    statb;
  
@@ -145,20 +154,11 @@
 +#endif
      if (stat ((const char *) file, &statb) != 0)
  	return FcFalse;
-+
      return S_ISDIR(statb.st_mode);
- }
- 
-@@ -161,10 +174,14 @@
-     strcpy ((char *) file, (char *) dir);
-     strcat ((char *) file, "/");
-     base = file + strlen ((char *) file);
--    
-+
+@@ -165,6 +177,10 @@
      if (FcDebug () & FC_DBG_SCAN)
  	printf ("\tScanning dir %s\n", dir);
--	
-+
+ 	
 +#ifdef BSD_CAPABILITIES
 +    if(ld_insandbox()) d = ua_opendir((char *) dir);
 +    else
@@ -168,7 +168,7 @@
      {
 diff -ruN src/fcxml.c src/fcxml.c
 --- src/fcxml.c	2008-05-25 01:12:34.000000000 +0100
-+++ src/fcxml.c	2009-07-12 21:10:42.000000000 +0100
++++ src/fcxml.c	2009-07-12 21:14:51.000000000 +0100
 @@ -52,6 +52,10 @@
  
  #endif /* ENABLE_LIBXML2 */


More information about the p4-projects mailing list