summaryrefslogtreecommitdiff
path: root/x11/XFree86-libs/patches
diff options
context:
space:
mode:
Diffstat (limited to 'x11/XFree86-libs/patches')
-rw-r--r--x11/XFree86-libs/patches/patch-aa14
-rw-r--r--x11/XFree86-libs/patches/patch-ab23
-rw-r--r--x11/XFree86-libs/patches/patch-ac22
-rw-r--r--x11/XFree86-libs/patches/patch-ad13
-rw-r--r--x11/XFree86-libs/patches/patch-ae46
-rw-r--r--x11/XFree86-libs/patches/patch-af58
-rw-r--r--x11/XFree86-libs/patches/patch-ag41
-rw-r--r--x11/XFree86-libs/patches/patch-ah15
-rw-r--r--x11/XFree86-libs/patches/patch-ai32
-rw-r--r--x11/XFree86-libs/patches/patch-aj49
-rw-r--r--x11/XFree86-libs/patches/patch-ak13
-rw-r--r--x11/XFree86-libs/patches/patch-al31
-rw-r--r--x11/XFree86-libs/patches/patch-am179
-rw-r--r--x11/XFree86-libs/patches/patch-an68
-rw-r--r--x11/XFree86-libs/patches/patch-ao30
-rw-r--r--x11/XFree86-libs/patches/patch-ap13
-rw-r--r--x11/XFree86-libs/patches/patch-aq36
-rw-r--r--x11/XFree86-libs/patches/patch-ar53
-rw-r--r--x11/XFree86-libs/patches/patch-as22
-rw-r--r--x11/XFree86-libs/patches/patch-at187
-rw-r--r--x11/XFree86-libs/patches/patch-au106
-rw-r--r--x11/XFree86-libs/patches/patch-av25
-rw-r--r--x11/XFree86-libs/patches/patch-aw51
-rw-r--r--x11/XFree86-libs/patches/patch-ax13
24 files changed, 0 insertions, 1140 deletions
diff --git a/x11/XFree86-libs/patches/patch-aa b/x11/XFree86-libs/patches/patch-aa
deleted file mode 100644
index 22aeee6f235..00000000000
--- a/x11/XFree86-libs/patches/patch-aa
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-aa,v 1.1.1.1 2004/01/24 08:47:28 xtraeme Exp $
-
---- programs/Xserver/hw/xfree86/parser/scan.c.orig 2003-07-15 23:55:49.000000000 +0000
-+++ programs/Xserver/hw/xfree86/parser/scan.c 2003-07-15 23:56:40.000000000 +0000
-@@ -425,7 +425,8 @@
- #ifndef XCONFENV
- #define XCONFENV "XF86CONFIG"
- #endif
--#ifndef XF86_VERSION_MAJOR
-+#define XF86_VERSION_MAJOR 4
-+#if 0
- #ifdef XVERSION
- #if XVERSION > 40000000
- #define XF86_VERSION_MAJOR (XVERSION / 10000000)
diff --git a/x11/XFree86-libs/patches/patch-ab b/x11/XFree86-libs/patches/patch-ab
deleted file mode 100644
index fc63926a56e..00000000000
--- a/x11/XFree86-libs/patches/patch-ab
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-ab,v 1.2 2004/03/28 22:06:15 xtraeme Exp $
-
---- config/cf/Library.tmpl.orig Mon Aug 27 10:40:55 2001
-+++ config/cf/Library.tmpl Wed Oct 16 21:53:13 2002
-@@ -300,6 +300,10 @@
- */
-
- #ifndef MakeStringsDependency
-+#if defined(UseInstalled) || defined(UseInstalledPrograms)
-+#define MakeStringsDependency @@\
-+MAKESTRS = @MAKESTRS@
-+#else
- # define MakeStringsDependency @@\
- MAKESTRS = $(CONFIGSRC)/util/makestrs @@\
- NoCmpScript(HostProgramTargetName($(MAKESTRS)) $(MAKESTRS).Osuf) @@\
-@@ -308,6 +312,7 @@
- cd $(CONFIGSRC)/util && $(MAKE) HostProgramTargetName(makestrs) @@\
- @@\
- includes:: HostProgramTargetName($(MAKESTRS))
-+#endif
- #endif
-
- #ifndef ToolkitMakeStrings
diff --git a/x11/XFree86-libs/patches/patch-ac b/x11/XFree86-libs/patches/patch-ac
deleted file mode 100644
index 75d85d91cae..00000000000
--- a/x11/XFree86-libs/patches/patch-ac
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-ac,v 1.2 2004/03/28 22:06:15 xtraeme Exp $
-
---- programs/Xserver/hw/xfree86/xf86config/xf86config.c.orig 2003-07-09 13:48:58.000000000 +0000
-+++ programs/Xserver/hw/xfree86/xf86config/xf86config.c 2003-07-09 13:49:42.000000000 +0000
-@@ -176,6 +176,9 @@
- #endif
- #define CONFIGNAME XCONFIGFILE
-
-+/* Comment this out for now ... */
-+
-+#if 0
- #ifndef XF86_VERSION_MAJOR
- #ifdef XVERSION
- #if XVERSION > 40000000
-@@ -187,6 +190,7 @@
- #define XF86_VERSION_MAJOR 4
- #endif
- #endif
-+#endif
-
-
- int config_mousetype; /* Mouse. */
diff --git a/x11/XFree86-libs/patches/patch-ad b/x11/XFree86-libs/patches/patch-ad
deleted file mode 100644
index 610edcd0624..00000000000
--- a/x11/XFree86-libs/patches/patch-ad
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ad,v 1.2 2004/03/28 22:06:15 xtraeme Exp $
-
---- programs/Xserver/dix/main.c.orig 2003-07-07 01:39:11.000000000 +0000
-+++ programs/Xserver/dix/main.c 2003-07-07 01:43:07.000000000 +0000
-@@ -505,7 +505,7 @@
- /* Leave off the ridBase and ridMask, these must be sent with
- connection */
-
-- setup.release = VENDOR_RELEASE;
-+ setup.release = NULL;
- /*
- * per-server image and bitmap parameters are defined in Xmd.h
- */
diff --git a/x11/XFree86-libs/patches/patch-ae b/x11/XFree86-libs/patches/patch-ae
deleted file mode 100644
index 4401ca0a98b..00000000000
--- a/x11/XFree86-libs/patches/patch-ae
+++ /dev/null
@@ -1,46 +0,0 @@
-$NetBSD: patch-ae,v 1.2 2004/03/28 22:06:15 xtraeme Exp $
-
---- config/cf/NetBSD.cf.in.orig 2004-03-03 07:53:38.000000000 +0000
-+++ config/cf/NetBSD.cf.in 2004-03-03 07:54:59.000000000 +0000
-@@ -143,7 +143,7 @@
- #define MkdirHierCmd mkdir -p
-
- #undef CcCmd
--#define CcCmd gcc
-+#define CcCmd @@PKGSRC_CC@@
- #ifndef DefaultCCOptions
- #if defined(UseInstalled)
- #define DefaultCCOptions /**/
-@@ -159,7 +159,7 @@
- #endif
- #endif
-
--#define CppCmd cpp
-+#define CppCmd @@PKGSRC_CPP@@
- #define StandardCppOptions -traditional
- #define StandardCppDefines /**/
- #define PreProcessCmd CcCmd -E
-@@ -208,13 +208,7 @@
- #define HasWeakSymbols UseElfFormat
-
- #ifdef i386Architecture
--# ifndef DefaultGcc2i386Opt
--# if OSMajorVersion > 1 || (OSMajorVersion == 1 && OSMinorVersion > 2)
-- /* The GCC strength-reduce bug is fixed for NetBSD 1.3 and later */
--# define DefaultGcc2i386Opt -O2 GccAliasingArgs
--# endif
--# endif
--# define OptimizedCDebugFlags DefaultGcc2i386Opt
-+# define OptimizedCDebugFlags @@PKGSRC_CFLAGS@@
- # if OSMajorVersion < 1
- # define ServerOSDefines XFree86ServerOSDefines -DXNO_SYSCONF
- # else
-@@ -224,7 +218,7 @@
- # define ServerExtraSysLibs -li386
- # endif
- #else
--# define OptimizedCDebugFlags -O2
-+# define OptimizedCDebugFlags @@PKGSRC_CFLAGS@@
- # if defined(SparcArchitecture)
- # define ServerOSDefines -DDDXOSINIT
- # elif defined(AlphaArchitecture)
diff --git a/x11/XFree86-libs/patches/patch-af b/x11/XFree86-libs/patches/patch-af
deleted file mode 100644
index 644dc2a8d46..00000000000
--- a/x11/XFree86-libs/patches/patch-af
+++ /dev/null
@@ -1,58 +0,0 @@
-$NetBSD: patch-af,v 1.2 2004/03/28 22:06:15 xtraeme Exp $
-
---- config/cf/FreeBSD.cf.in.orig 2004-03-03 07:40:43.000000000 +0000
-+++ config/cf/FreeBSD.cf.in 2004-03-03 07:44:05.000000000 +0000
-@@ -190,11 +190,11 @@
- # define CcCmd $(CLIENTENVSETUP) cc
- # define CplusplusCmd $(CLIENTENVSETUP) c++
- #else
--# define CcCmd cc
--# define CplusplusCmd c++
-+# define CcCmd @@PKGSRC_CC@@
-+# define CplusplusCmd @@PKGSRC_CXX@@
- #endif
-
--#define CppCmd /usr/bin/cpp
-+#define CppCmd @@PKGSRC_CPP@@
- #define PreProcessCmd CppCmd
- #define StandardCppOptions -traditional
- #define StandardCppDefines /**/
-@@ -207,7 +207,7 @@
- #else
- #define NoSystemWarn
- #endif
--#define DefaultCCOptions -ansi -pedantic NoSystemWarn -Dasm=__asm \
-+#define DefaultCCOptions -ansi NoSystemWarn -Dasm=__asm \
- GccWarningOptions
- #endif
- #endif
-@@ -439,18 +439,8 @@
- #define XawI18nDefines -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
- #endif
-
--/* The GCC strength-reduce bug is fixed for FreeBSD 2.1.5 and later */
--#ifndef DefaultGcc2i386Opt
--#if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion > 1) || (OSMajorVersion == 2 && OSMinorVersion == 1 && OSTeenyVersion >= 5)
--#define DefaultGcc2i386Opt -O2 GccAliasingArgs
--#endif
--#endif
--
--#ifdef i386Architecture
--# define OptimizedCDebugFlags DefaultGcc2i386Opt
--#else
--# define OptimizedCDebugFlags -O
--#endif
-+#define DefaultGcc2i386Opt
-+#define OptimizedCDebugFlags @@PKGSRC_CFLAGS@@
-
- #ifndef PreIncDir
- # define PreIncDir /usr/include
-@@ -476,7 +466,7 @@
- * Compress manual pages
- */
- #ifndef CompressManPages
--# define CompressManPages YES
-+# define CompressManPages NO
- #endif
-
- #if OSMajorVersion > 2 || (OSMajorVersion == 2 && OSMinorVersion >= 1)
diff --git a/x11/XFree86-libs/patches/patch-ag b/x11/XFree86-libs/patches/patch-ag
deleted file mode 100644
index ca43c336d0d..00000000000
--- a/x11/XFree86-libs/patches/patch-ag
+++ /dev/null
@@ -1,41 +0,0 @@
-$NetBSD: patch-ag,v 1.2 2004/03/28 22:06:15 xtraeme Exp $
-
---- config/cf/linux.cf.in.orig 2004-03-03 07:44:42.000000000 +0000
-+++ config/cf/linux.cf.in 2004-03-03 07:46:51.000000000 +0000
-@@ -549,15 +549,15 @@
- # if defined (i386Architecture) && ((GccMajorVersion >3) \
- || ((GccMajorVersion == 3) && (GccMinorVersion >= 1)))
- # ifndef CcCmd
--# define CcCmd gcc -m32
-+# define CcCmd @@PKGSRC_CC@@
- # endif
- # ifndef CplusplusCmd
--# define CplusplusCmd c++ -m32
-+# define CplusplusCmd @@PKGSRC_CXX@@
- # endif
- # endif
- # ifndef CcCmd
--# define CcCmd gcc
--# define CplusplusCmd c++
-+# define CcCmd @@PKGSRC_CC@@
-+# define CplusplusCmd @@PKGSRC_CXX@@
- # endif
- # ifndef AsCmd
- # define AsCmd CcCmd -c -x assembler
-@@ -721,7 +721,6 @@
- #define YaccCmd bison -y
- #define LexCmd flex -l
- #define HasFlex YES
--#define LexLib -lfl
- #define PreProcessCmd CcCmd -E
- #define PostIncDir DefaultGccIncludeDir
- #define LdCombineFlags -r
-@@ -791,7 +790,7 @@
-
- #ifdef i386Architecture
- # ifndef OptimizedCDebugFlags
--# define OptimizedCDebugFlags DefaultGcc2i386Opt
-+# define OptimizedCDebugFlags @@PKGSRC_CFLAGS@@
- # endif
- # define LinuxMachineDefines -D__i386__
- # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME
diff --git a/x11/XFree86-libs/patches/patch-ah b/x11/XFree86-libs/patches/patch-ah
deleted file mode 100644
index d2a2dd6bd89..00000000000
--- a/x11/XFree86-libs/patches/patch-ah
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-ah,v 1.2 2004/03/28 22:06:15 xtraeme Exp $
-
-http://www.mail-archive.com/devel@xfree86.org/msg04688.html
-
---- ./lib/XvMC/hw/i810/Imakefile.orig 2002-10-30 10:42:57.000000000 -0800
-+++ ./lib/XvMC/hw/i810/Imakefile
-@@ -20,7 +20,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
- DEFINES = $(ALLOC_DEFINES) -DTRUE=1 -DFALSE=0
- INCLUDES = -I$(XINCLUDESRC) -I$(INCLUDESRC) -I$(XLIBSRC) -I$(EXTINCSRC) \
- -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86OSSRC)/linux/drm/kernel \
-- -I$(XF86DRIVERSRC)/i810
-+ -I$(XF86DRIVERSRC)/i810 -I$(XF86OSSRC)/shared/drm/kernel
- SRCS = I810XvMC.c
- OBJS = I810XvMC.o xf86drm.o xf86drmHash.o xf86drmRandom.o xf86drmSL.o
- LINTLIBS = $(LINTXLIB)
diff --git a/x11/XFree86-libs/patches/patch-ai b/x11/XFree86-libs/patches/patch-ai
deleted file mode 100644
index 4e1a8ef0fe4..00000000000
--- a/x11/XFree86-libs/patches/patch-ai
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-ai,v 1.4 2004/11/07 12:57:37 markd Exp $
-
---- config/cf/sun.cf.in.orig 2004-02-02 16:55:26.000000000 +1300
-+++ config/cf/sun.cf.in
-@@ -19,6 +19,12 @@ XCOMM platform: $XFree86: xc/config/cf/
- #endif
- XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
-
-+/* This is the XFree86 package - we want to build XFree86 on Solaris */
-+#define BuildXFree86OnSparcSunOS YES
-+#define HasZlib YES
-+#define HasSunC NO
-+#define HasGcc2 YES
-+
- /*
- * Compiler setup. This sun.cf file knows what options to use with
- * certain compilers, including Sun C, CenterLine C, and gcc. It
-@@ -224,6 +230,14 @@ XCOMM SunPro C++ CplusplusCompilerMajorV
- #endif
- #endif
-
-+#define CcCmd @@PKGSRC_CC@@
-+#define LdCmd @@PKGSRC_CC@@
-+#define CplusplusCmd @@PKGSRC_CXX@@
-+#define OptimizedCDebugFlags @@PKGSRC_CFLAGS@@
-+#define ExtraLoadFlags -Wl,-R$(USRLIBDIRPATH)
-+#define SharedLibraryLoadFlags -shared ExtraLoadFlags
-+#define HasLdRunPath NO
-+
- # if HasSunC && (CCompilerMajorVersion < 3)
- # define BootstrapCFlags -DSVR4
- # else
diff --git a/x11/XFree86-libs/patches/patch-aj b/x11/XFree86-libs/patches/patch-aj
deleted file mode 100644
index 32f082f89b9..00000000000
--- a/x11/XFree86-libs/patches/patch-aj
+++ /dev/null
@@ -1,49 +0,0 @@
-$NetBSD: patch-aj,v 1.3 2004/07/21 22:21:49 xtraeme Exp $
-
---- config/cf/OpenBSD.cf.in.orig 2004-07-22 00:18:37.000000000 +0200
-+++ config/cf/OpenBSD.cf.in 2004-07-22 00:19:48.000000000 +0200
-@@ -162,7 +162,7 @@
- #define MkdirHierCmd mkdir -p
-
- #ifndef CppCmd
--#define CppCmd /usr/libexec/cpp
-+#define CppCmd @@PKGSRC_CPP@@
- #endif
- #define StandardCppOptions -traditional
- #define StandardCppDefines /**/
-@@ -170,10 +170,10 @@
- #define PreIncDir DefaultGccIncludeDir
-
- #ifndef CcCmd
--#define CcCmd cc
-+#define CcCmd @@PKGSRC_CC@@
- #endif
- #ifndef AsCmd
--#define AsCmd cc -c -x assembler
-+#define AsCmd @@PKGSRC_CC@@ -c -x assembler
- #endif
- #ifndef DefaultCCOptions
- #if defined(UseInstalled)
-@@ -226,7 +226,6 @@
-
- #define HasBsdMake YES
-
--#define BuildCyrillicFonts YES
- #define GzipFontCompression YES
- #define DefaultUserPath /bin:/usr/bin:/usr/local/bin:$(BINDIR)
- #define DefaultSystemPath /sbin:/usr/sbin:/bin:/usr/bin:$(BINDIR)
-@@ -481,13 +480,7 @@
- # endif
-
-
--# ifndef DefaultGcc2i386Opt
--# if (OSMajorVersion == 2 && OSMinorVersion >= 3) || OSMajorVersion > 2
-- /* The GCC strength-reduce bug is fixed for OpenBSD 2.3 and later */
--# define DefaultGcc2i386Opt -O2 GccAliasingArgs
--# endif
--# endif
--# define OptimizedCDebugFlags DefaultGcc2i386Opt
-+# define OptimizedCDebugFlags @@PKGSRC_CFLAGS@@
- # define ServerOSDefines XFree86ServerOSDefines -DDDXTIME
- # define ServerExtraSysLibs -li386
- # define LdPostLib /**/
diff --git a/x11/XFree86-libs/patches/patch-ak b/x11/XFree86-libs/patches/patch-ak
deleted file mode 100644
index 48a15aca833..00000000000
--- a/x11/XFree86-libs/patches/patch-ak
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ak,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/data.c.orig 2002-01-07 13:40:49.000000000 -0600
-+++ extras/Xpm/lib/data.c
-@@ -375,7 +375,7 @@ xpmGetCmt(data, cmt)
- {
- if (!data->type)
- *cmt = NULL;
-- else if (data->CommentLength) {
-+ else if (data->CommentLength != 0 && data->CommentLength < SIZE_MAX - 1) {
- *cmt = (char *) XpmMalloc(data->CommentLength + 1);
- strncpy(*cmt, data->Comment, data->CommentLength);
- (*cmt)[data->CommentLength] = '\0';
diff --git a/x11/XFree86-libs/patches/patch-al b/x11/XFree86-libs/patches/patch-al
deleted file mode 100644
index 6145f9d1238..00000000000
--- a/x11/XFree86-libs/patches/patch-al
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-al,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/hashtab.c.orig 1999-01-11 07:23:11.000000000 -0600
-+++ extras/Xpm/lib/hashtab.c
-@@ -135,7 +135,7 @@ HashTableGrows(table)
- xpmHashTable *table;
- {
- xpmHashAtom *atomTable = table->atomTable;
-- int size = table->size;
-+ unsigned int size = table->size;
- xpmHashAtom *t, *p;
- int i;
- int oldSize = size;
-@@ -144,6 +144,8 @@ HashTableGrows(table)
- HASH_TABLE_GROWS
- table->size = size;
- table->limit = size / 3;
-+ if (size >= SIZE_MAX / sizeof(*atomTable))
-+ return (XpmNoMemory);
- atomTable = (xpmHashAtom *) XpmMalloc(size * sizeof(*atomTable));
- if (!atomTable)
- return (XpmNoMemory);
-@@ -204,6 +206,8 @@ xpmHashTableInit(table)
- table->size = INITIAL_HASH_SIZE;
- table->limit = table->size / 3;
- table->used = 0;
-+ if (table->size >= SIZE_MAX / sizeof(*atomTable))
-+ return (XpmNoMemory);
- atomTable = (xpmHashAtom *) XpmMalloc(table->size * sizeof(*atomTable));
- if (!atomTable)
- return (XpmNoMemory);
diff --git a/x11/XFree86-libs/patches/patch-am b/x11/XFree86-libs/patches/patch-am
deleted file mode 100644
index 9215c09d26c..00000000000
--- a/x11/XFree86-libs/patches/patch-am
+++ /dev/null
@@ -1,179 +0,0 @@
-$NetBSD: patch-am,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/parse.c.orig 2001-10-27 22:32:10.000000000 -0500
-+++ extras/Xpm/lib/parse.c
-@@ -44,6 +44,24 @@
- #include <ctype.h>
- #include <string.h>
-
-+#ifdef HAS_STRLCAT
-+# define STRLCAT(dst, src, dstsize) { \
-+ if (strlcat(dst, src, dstsize) >= (dstsize)) \
-+ return (XpmFileInvalid); }
-+# define STRLCPY(dst, src, dstsize) { \
-+ if (strlcpy(dst, src, dstsize) >= (dstsize)) \
-+ return (XpmFileInvalid); }
-+#else
-+# define STRLCAT(dst, src, dstsize) { \
-+ if ((strlen(dst) + strlen(src)) < (dstsize)) \
-+ strcat(dst, src); \
-+ else return (XpmFileInvalid); }
-+# define STRLCPY(dst, src, dstsize) { \
-+ if (strlen(src) < (dstsize)) \
-+ strcpy(dst, src); \
-+ else return (XpmFileInvalid); }
-+#endif
-+
- LFUNC(ParsePixels, int, (xpmData *data, unsigned int width,
- unsigned int height, unsigned int ncolors,
- unsigned int cpp, XpmColor *colorTable,
-@@ -66,7 +84,7 @@ xpmParseValues(data, width, height, ncol
- unsigned int *extensions;
- {
- unsigned int l;
-- char buf[BUFSIZ];
-+ char buf[BUFSIZ + 1];
-
- if (!data->format) { /* XPM 2 or 3 */
-
-@@ -175,10 +193,10 @@ xpmParseColors(data, ncolors, cpp, color
- XpmColor **colorTablePtr;
- xpmHashTable *hashtable;
- {
-- unsigned int key = 0, l, a, b;
-+ unsigned int key = 0, l, a, b, len;
- unsigned int curkey; /* current color key */
- unsigned int lastwaskey; /* key read */
-- char buf[BUFSIZ];
-+ char buf[BUFSIZ+1];
- char curbuf[BUFSIZ]; /* current buffer */
- char **sptr, *s;
- XpmColor *color;
-@@ -186,6 +204,8 @@ xpmParseColors(data, ncolors, cpp, color
- char **defaults;
- int ErrorStatus;
-
-+ if (ncolors >= SIZE_MAX / sizeof(XpmColor))
-+ return (XpmNoMemory);
- colorTable = (XpmColor *) XpmCalloc(ncolors, sizeof(XpmColor));
- if (!colorTable)
- return (XpmNoMemory);
-@@ -197,6 +217,10 @@ xpmParseColors(data, ncolors, cpp, color
- /*
- * read pixel value
- */
-+ if (cpp >= SIZE_MAX - 1) {
-+ xpmFreeColorTable(colorTable, ncolors);
-+ return (XpmNoMemory);
-+ }
- color->string = (char *) XpmMalloc(cpp + 1);
- if (!color->string) {
- xpmFreeColorTable(colorTable, ncolors);
-@@ -234,13 +258,14 @@ xpmParseColors(data, ncolors, cpp, color
- }
- if (!lastwaskey && key < NKEYS) { /* open new key */
- if (curkey) { /* flush string */
-- s = (char *) XpmMalloc(strlen(curbuf) + 1);
-+ len = strlen(curbuf) + 1;
-+ s = (char *) XpmMalloc(len);
- if (!s) {
- xpmFreeColorTable(colorTable, ncolors);
- return (XpmNoMemory);
- }
- defaults[curkey] = s;
-- strcpy(s, curbuf);
-+ memcpy(s, curbuf, len);
- }
- curkey = key + 1; /* set new key */
- *curbuf = '\0'; /* reset curbuf */
-@@ -251,9 +276,9 @@ xpmParseColors(data, ncolors, cpp, color
- return (XpmFileInvalid);
- }
- if (!lastwaskey)
-- strcat(curbuf, " "); /* append space */
-+ STRLCAT(curbuf, " ", sizeof(curbuf)); /* append space */
- buf[l] = '\0';
-- strcat(curbuf, buf);/* append buf */
-+ STRLCAT(curbuf, buf, sizeof(curbuf));/* append buf */
- lastwaskey = 0;
- }
- }
-@@ -261,12 +286,13 @@ xpmParseColors(data, ncolors, cpp, color
- xpmFreeColorTable(colorTable, ncolors);
- return (XpmFileInvalid);
- }
-- s = defaults[curkey] = (char *) XpmMalloc(strlen(curbuf) + 1);
-+ len = strlen(curbuf) + 1;
-+ s = defaults[curkey] = (char *) XpmMalloc(len);
- if (!s) {
- xpmFreeColorTable(colorTable, ncolors);
- return (XpmNoMemory);
- }
-- strcpy(s, curbuf);
-+ memcpy(s, curbuf, len);
- }
- } else { /* XPM 1 */
- /* get to the beginning of the first string */
-@@ -279,6 +305,10 @@ xpmParseColors(data, ncolors, cpp, color
- /*
- * read pixel value
- */
-+ if (cpp >= SIZE_MAX - 1) {
-+ xpmFreeColorTable(colorTable, ncolors);
-+ return (XpmNoMemory);
-+ }
- color->string = (char *) XpmMalloc(cpp + 1);
- if (!color->string) {
- xpmFreeColorTable(colorTable, ncolors);
-@@ -307,16 +337,17 @@ xpmParseColors(data, ncolors, cpp, color
- *curbuf = '\0'; /* init curbuf */
- while ((l = xpmNextWord(data, buf, BUFSIZ))) {
- if (*curbuf != '\0')
-- strcat(curbuf, " ");/* append space */
-+ STRLCAT(curbuf, " ", sizeof(curbuf));/* append space */
- buf[l] = '\0';
-- strcat(curbuf, buf); /* append buf */
-+ STRLCAT(curbuf, buf, sizeof(curbuf)); /* append buf */
- }
-- s = (char *) XpmMalloc(strlen(curbuf) + 1);
-+ len = strlen(curbuf) + 1;
-+ s = (char *) XpmMalloc(len);
- if (!s) {
- xpmFreeColorTable(colorTable, ncolors);
- return (XpmNoMemory);
- }
-- strcpy(s, curbuf);
-+ memcpy(s, curbuf, len);
- color->c_color = s;
- *curbuf = '\0'; /* reset curbuf */
- if (a < ncolors - 1)
-@@ -341,6 +372,9 @@ ParsePixels(data, width, height, ncolors
- unsigned int *iptr, *iptr2;
- unsigned int a, x, y;
-
-+ if ((height > 0 && width >= SIZE_MAX / height) ||
-+ width * height >= SIZE_MAX / sizeof(unsigned int))
-+ return XpmNoMemory;
- #ifndef FOR_MSW
- iptr2 = (unsigned int *) XpmMalloc(sizeof(unsigned int) * width * height);
- #else
-@@ -364,6 +398,9 @@ ParsePixels(data, width, height, ncolors
- {
- unsigned short colidx[256];
-
-+ if (ncolors > 256)
-+ return (XpmFileInvalid);
-+
- bzero((char *)colidx, 256 * sizeof(short));
- for (a = 0; a < ncolors; a++)
- colidx[(unsigned char)colorTable[a].string[0]] = a + 1;
-@@ -442,6 +479,9 @@ if (cidx[f]) XpmFree(cidx[f]);}
- char *s;
- char buf[BUFSIZ];
-
-+ if (cpp >= sizeof(buf))
-+ return (XpmFileInvalid);
-+
- buf[cpp] = '\0';
- if (USE_HASHTABLE) {
- xpmHashAtom *slot;
diff --git a/x11/XFree86-libs/patches/patch-an b/x11/XFree86-libs/patches/patch-an
deleted file mode 100644
index a3c6fd1e4bf..00000000000
--- a/x11/XFree86-libs/patches/patch-an
+++ /dev/null
@@ -1,68 +0,0 @@
-$NetBSD: patch-an,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/scan.c.orig 2002-01-07 13:40:49.000000000 -0600
-+++ extras/Xpm/lib/scan.c
-@@ -107,7 +107,8 @@ LFUNC(MSWGetImagePixels, int, (Display *
- LFUNC(ScanTransparentColor, int, (XpmColor *color, unsigned int cpp,
- XpmAttributes *attributes));
-
--LFUNC(ScanOtherColors, int, (Display *display, XpmColor *colors, int ncolors,
-+LFUNC(ScanOtherColors, int, (Display *display, XpmColor *colors,
-+ unsigned int ncolors,
- Pixel *pixels, unsigned int mask,
- unsigned int cpp, XpmAttributes *attributes));
-
-@@ -232,11 +233,17 @@ XpmCreateXpmImageFromImage(display, imag
- else
- cpp = 0;
-
-+ if ((height > 0 && width >= SIZE_MAX / height) ||
-+ width * height >= SIZE_MAX / sizeof(unsigned int))
-+ RETURN(XpmNoMemory);
- pmap.pixelindex =
- (unsigned int *) XpmCalloc(width * height, sizeof(unsigned int));
- if (!pmap.pixelindex)
- RETURN(XpmNoMemory);
-
-+ if (pmap.size >= SIZE_MAX / sizeof(Pixel))
-+ RETURN(XpmNoMemory);
-+
- pmap.pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * pmap.size);
- if (!pmap.pixels)
- RETURN(XpmNoMemory);
-@@ -302,6 +309,8 @@ XpmCreateXpmImageFromImage(display, imag
- * color
- */
-
-+ if (pmap.ncolors >= SIZE_MAX / sizeof(XpmColor))
-+ RETURN(XpmNoMemory);
- colorTable = (XpmColor *) XpmCalloc(pmap.ncolors, sizeof(XpmColor));
- if (!colorTable)
- RETURN(XpmNoMemory);
-@@ -360,6 +369,8 @@ ScanTransparentColor(color, cpp, attribu
-
- /* first get a character string */
- a = 0;
-+ if (cpp >= SIZE_MAX - 1)
-+ return (XpmNoMemory);
- if (!(s = color->string = (char *) XpmMalloc(cpp + 1)))
- return (XpmNoMemory);
- *s++ = printable[c = a % MAXPRINTABLE];
-@@ -407,7 +418,7 @@ static int
- ScanOtherColors(display, colors, ncolors, pixels, mask, cpp, attributes)
- Display *display;
- XpmColor *colors;
-- int ncolors;
-+ unsigned int ncolors;
- Pixel *pixels;
- unsigned int mask;
- unsigned int cpp;
-@@ -451,6 +462,8 @@ ScanOtherColors(display, colors, ncolors
- }
-
- /* first get character strings and rgb values */
-+ if (ncolors >= SIZE_MAX / sizeof(XColor) || cpp >= SIZE_MAX - 1)
-+ return (XpmNoMemory);
- xcolors = (XColor *) XpmMalloc(sizeof(XColor) * ncolors);
- if (!xcolors)
- return (XpmNoMemory);
diff --git a/x11/XFree86-libs/patches/patch-ao b/x11/XFree86-libs/patches/patch-ao
deleted file mode 100644
index 2a6e740dcaa..00000000000
--- a/x11/XFree86-libs/patches/patch-ao
+++ /dev/null
@@ -1,30 +0,0 @@
-$NetBSD: patch-ao,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/Attrib.c.orig 1999-01-11 07:23:09.000000000 -0600
-+++ extras/Xpm/lib/Attrib.c
-@@ -35,7 +35,7 @@
- #include "XpmI.h"
-
- /* 3.2 backward compatibility code */
--LFUNC(CreateOldColorTable, int, (XpmColor *ct, int ncolors,
-+LFUNC(CreateOldColorTable, int, (XpmColor *ct, unsigned int ncolors,
- XpmColor ***oldct));
-
- LFUNC(FreeOldColorTable, void, (XpmColor **colorTable, int ncolors));
-@@ -46,12 +46,15 @@ LFUNC(FreeOldColorTable, void, (XpmColor
- static int
- CreateOldColorTable(ct, ncolors, oldct)
- XpmColor *ct;
-- int ncolors;
-+ unsigned int ncolors;
- XpmColor ***oldct;
- {
- XpmColor **colorTable, **color;
- int a;
-
-+ if (ncolors >= SIZE_MAX / sizeof(XpmColor *))
-+ return XpmNoMemory;
-+
- colorTable = (XpmColor **) XpmMalloc(ncolors * sizeof(XpmColor *));
- if (!colorTable) {
- *oldct = NULL;
diff --git a/x11/XFree86-libs/patches/patch-ap b/x11/XFree86-libs/patches/patch-ap
deleted file mode 100644
index d8391259806..00000000000
--- a/x11/XFree86-libs/patches/patch-ap
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ap,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/CrDatFrI.c.orig 2001-10-27 22:32:09.000000000 -0500
-+++ extras/Xpm/lib/CrDatFrI.c
-@@ -124,6 +124,8 @@ XpmCreateDataFromXpmImage(data_return, i
- */
- header_nlines = 1 + image->ncolors;
- header_size = sizeof(char *) * header_nlines;
-+ if (header_size >= SIZE_MAX / sizeof(char *))
-+ return (XpmNoMemory);
- header = (char **) XpmCalloc(header_size, sizeof(char *));
- if (!header)
- return (XpmNoMemory);
diff --git a/x11/XFree86-libs/patches/patch-aq b/x11/XFree86-libs/patches/patch-aq
deleted file mode 100644
index 436da06043a..00000000000
--- a/x11/XFree86-libs/patches/patch-aq
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD: patch-aq,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/XpmI.h.orig 2003-08-06 09:03:58.000000000 -0500
-+++ extras/Xpm/lib/XpmI.h
-@@ -86,6 +86,18 @@ extern FILE *popen();
- boundCheckingCalloc((long)(nelem),(long) (elsize))
- #endif
-
-+#if defined(SCO) || defined(__USLC__)
-+#include <stdint.h> /* For SIZE_MAX */
-+#endif
-+#include <limits.h>
-+#ifndef SIZE_MAX
-+# ifdef ULONG_MAX
-+# define SIZE_MAX ULONG_MAX
-+# else
-+# define SIZE_MAX UINT_MAX
-+# endif
-+#endif
-+
- #define XPMMAXCMTLEN BUFSIZ
- typedef struct {
- unsigned int type;
-@@ -187,9 +199,9 @@ typedef struct _xpmHashAtom {
- } *xpmHashAtom;
-
- typedef struct {
-- int size;
-- int limit;
-- int used;
-+ unsigned int size;
-+ unsigned int limit;
-+ unsigned int used;
- xpmHashAtom *atomTable;
- } xpmHashTable;
-
diff --git a/x11/XFree86-libs/patches/patch-ar b/x11/XFree86-libs/patches/patch-ar
deleted file mode 100644
index 1e0b84c3886..00000000000
--- a/x11/XFree86-libs/patches/patch-ar
+++ /dev/null
@@ -1,53 +0,0 @@
-$NetBSD: patch-ar,v 1.3 2004/09/16 19:28:56 minskim Exp $
-
---- extras/Xpm/lib/create.c.orig 2003-10-07 16:25:37.000000000 -0500
-+++ extras/Xpm/lib/create.c
-@@ -816,6 +816,9 @@ XpmCreateImageFromXpmImage(display, imag
-
- ErrorStatus = XpmSuccess;
-
-+ if (image->ncolors >= SIZE_MAX / sizeof(Pixel))
-+ return (XpmNoMemory);
-+
- /* malloc pixels index tables */
- image_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * image->ncolors);
- if (!image_pixels)
-@@ -988,6 +991,8 @@ CreateXImage(display, visual, depth, for
- return (XpmNoMemory);
-
- #if !defined(FOR_MSW) && !defined(AMIGA)
-+ if (height != 0 && (*image_return)->bytes_per_line >= SIZE_MAX / height)
-+ return XpmNoMemory;
- /* now that bytes_per_line must have been set properly alloc data */
- (*image_return)->data =
- (char *) XpmMalloc((*image_return)->bytes_per_line * height);
-@@ -2055,6 +2060,9 @@ xpmParseDataAndCreate(display, data, ima
- xpmGetCmt(data, &colors_cmt);
-
- /* malloc pixels index tables */
-+ if (ncolors >= SIZE_MAX / sizeof(Pixel))
-+ return XpmNoMemory;
-+
- image_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * ncolors);
- if (!image_pixels)
- RETURN(XpmNoMemory);
-@@ -2309,7 +2317,8 @@ ParseAndPutPixels(
- }
- obm = SelectObject(*dc, image->bitmap);
- #endif
--
-+ if (ncolors > 256)
-+ return (XpmFileInvalid);
-
- bzero((char *)colidx, 256 * sizeof(short));
- for (a = 0; a < ncolors; a++)
-@@ -2415,6 +2424,9 @@ if (cidx[f]) XpmFree(cidx[f]);}
- char *s;
- char buf[BUFSIZ];
-
-+ if (cpp >= sizeof(buf))
-+ return (XpmFileInvalid);
-+
- buf[cpp] = '\0';
- if (USE_HASHTABLE) {
- xpmHashAtom *slot;
diff --git a/x11/XFree86-libs/patches/patch-as b/x11/XFree86-libs/patches/patch-as
deleted file mode 100644
index 890914656c8..00000000000
--- a/x11/XFree86-libs/patches/patch-as
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-as,v 1.3 2004/11/07 12:57:37 markd Exp $
-
---- config/cf/sunLib.tmpl.orig 2003-07-12 10:17:41.000000000 +1200
-+++ config/cf/sunLib.tmpl
-@@ -57,6 +57,17 @@ XCOMM $XFree86: xc/config/cf/sunLib.tmpl
- # define SharedXrenderReqs $(LDPRELIB) $(XLIB)
- # define FixupLibReferences() /**/
-
-+#define SharedX11Reqs $(LDPRELIB) -lsocket -lnsl
-+#define SharedXlibi18nReqs $(LDPRELIB) $(XONLYLIB)
-+#define SharedOldXReqs $(LDPRELIBS) $(XONLYLIB)
-+#define SharedXtReqs $(LDPRELIBS) $(XONLYLIB) $(SMLIB) $(ICELIB)
-+#define SharedXaw6Reqs $(LDPRELIBS) $(XMULIB) $(XTOOLLIB) $(XLIB)
-+#define SharedXawReqs $(LDPRELIBS) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(XLIB)
-+#define SharedXextReqs $(LDPRELIBS) $(XONLYLIB)
-+#define SharedXiReqs $(LDPRELIBS) $(XLIB)
-+#define SharedXtstReqs $(LDPRELIBS) $(XLIB)
-+#define SharedSMReqs $(LDPRELIBS) $(ICELIB)
-+
- # define SharedPamReqs -ldl
- # define SharedPamUnixReqs $(LDPRELIBS) -lpam $(LDPOSTLIBS) -lnsl -lmp -lcmd SharedThreadReqs
- # define SharedPamSampleReqs $(LDPRELIBS) -lpam $(LDPOSTLIBS) SharedThreadReqs
diff --git a/x11/XFree86-libs/patches/patch-at b/x11/XFree86-libs/patches/patch-at
deleted file mode 100644
index 9056ef98577..00000000000
--- a/x11/XFree86-libs/patches/patch-at
+++ /dev/null
@@ -1,187 +0,0 @@
-$NetBSD: patch-at,v 1.3 2005/09/18 19:51:55 xtraeme Exp $
-
-Single patch to fix CAN-2005-2495.
-
---- programs/Xserver/afb/afbpixmap.c.orig Fri Apr 23 20:59:39 2004
-+++ programs/Xserver/afb/afbpixmap.c Sun Sep 18 04:56:02 2005
-@@ -73,10 +73,14 @@
- int depth;
- {
- PixmapPtr pPixmap;
-- int datasize;
-- int paddedWidth;
-+ size_t datasize;
-+ size_t paddedWidth;
-
- paddedWidth = BitmapBytePad(width);
-+
-+ if (paddedWidth > 32767 || height > 32767 || depth > 4)
-+ return NullPixmap;
-+
- datasize = height * paddedWidth * depth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
---- programs/Xserver/cfb/cfbpixmap.c.orig Fri Apr 23 21:00:12 2004
-+++ programs/Xserver/cfb/cfbpixmap.c Sun Sep 18 04:56:02 2005
-@@ -70,10 +70,13 @@
- int depth;
- {
- PixmapPtr pPixmap;
-- int datasize;
-- int paddedWidth;
-+ size_t datasize;
-+ size_t paddedWidth;
-
- paddedWidth = PixmapBytePad(width, depth);
-+
-+ if (paddedWidth / 4 > 32767 || height > 32767)
-+ return NullPixmap;
- datasize = height * paddedWidth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
---- programs/Xserver/dix/dispatch.c.orig Mon Dec 13 02:23:05 2004
-+++ programs/Xserver/dix/dispatch.c Sun Sep 18 04:56:02 2005
-@@ -1506,6 +1506,23 @@
- client->errorValue = 0;
- return BadValue;
- }
-+ if (stuff->width > 32767 || stuff->height > 32767)
-+ {
-+ /* It is allowed to try and allocate a pixmap which is larger than
-+ * 32767 in either dimension. However, all of the framebuffer code
-+ * is buggy and does not reliably draw to such big pixmaps, basically
-+ * because the Region data structure operates with signed shorts
-+ * for the rectangles in it.
-+ *
-+ * Furthermore, several places in the X server computes the
-+ * size in bytes of the pixmap and tries to store it in an
-+ * integer. This integer can overflow and cause the allocated size
-+ * to be much smaller.
-+ *
-+ * So, such big pixmaps are rejected here with a BadAlloc
-+ */
-+ return BadAlloc;
-+ }
- if (stuff->depth != 1)
- {
- pDepth = pDraw->pScreen->allowedDepths;
---- programs/Xserver/dix/pixmap.c.orig Fri Apr 23 21:04:44 2004
-+++ programs/Xserver/dix/pixmap.c Sun Sep 18 04:56:02 2005
-@@ -126,6 +126,9 @@
- unsigned size;
- int i;
-
-+ if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize)
-+ return NullPixmap;
-+
- pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize);
- if (!pPixmap)
- return NullPixmap;
---- programs/Xserver/fb/fbpixmap.c.orig Mon Aug 9 05:40:50 2004
-+++ programs/Xserver/fb/fbpixmap.c Sun Sep 18 04:56:02 2005
-@@ -32,12 +32,14 @@
- fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
- {
- PixmapPtr pPixmap;
-- int datasize;
-- int paddedWidth;
-+ size_t datasize;
-+ size_t paddedWidth;
- int adjust;
- int base;
-
- paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (FbBits);
-+ if (paddedWidth / 4 > 32767 || height > 32767)
-+ return NullPixmap;
- datasize = height * paddedWidth;
- #ifdef PIXPRIV
- base = pScreen->totalPixmapSize;
---- programs/Xserver/hw/xfree86/xaa/xaaInit.c.orig Fri Jul 30 22:30:56 2004
-+++ programs/Xserver/hw/xfree86/xaa/xaaInit.c Sun Sep 18 04:56:02 2005
-@@ -498,6 +498,9 @@
- XAAPixmapPtr pPriv;
- PixmapPtr pPix = NULL;
- int size = w * h;
-+
-+ if (w > 32767 || h > 32767)
-+ return NullPixmap;
-
- if (!infoRec->offscreenDepthsInitialized)
- XAAInitializeOffscreenDepths (pScreen);
---- programs/Xserver/hw/xfree86/xf4bpp/ppcPixmap.c.orig Fri Apr 23 21:54:17 2004
-+++ programs/Xserver/hw/xfree86/xf4bpp/ppcPixmap.c Sun Sep 18 04:56:02 2005
-@@ -85,7 +85,7 @@
- int depth ;
- {
- register PixmapPtr pPixmap = (PixmapPtr)NULL;
-- int size ;
-+ size_t size ;
-
- TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d)\n", pScreen, width, height, depth)) ;
-
-@@ -93,6 +93,10 @@
- return (PixmapPtr) NULL ;
-
- size = PixmapBytePad(width, depth);
-+
-+ if (size / 4 > 32767 || height > 32767)
-+ return (PixmapPtr) NULL ;
-+
- pPixmap = AllocatePixmap (pScreen, (height * size));
-
- if ( !pPixmap )
---- programs/Xserver/ilbm/ilbmpixmap.c.orig Fri Apr 23 21:54:22 2004
-+++ programs/Xserver/ilbm/ilbmpixmap.c Sun Sep 18 04:56:02 2005
-@@ -75,10 +75,12 @@
- int depth;
- {
- PixmapPtr pPixmap;
-- int datasize;
-- int paddedWidth;
-+ size_t datasize;
-+ size_t paddedWidth;
-
- paddedWidth = BitmapBytePad(width);
-+ if (paddedWidth > 32767 || height > 32767 || depth > 4)
-+ return NullPixmap;
- datasize = height * paddedWidth * depth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
---- programs/Xserver/iplan2p4/iplpixmap.c.orig Fri Apr 23 21:54:24 2004
-+++ programs/Xserver/iplan2p4/iplpixmap.c Sun Sep 18 04:56:02 2005
-@@ -74,12 +74,14 @@
- int depth;
- {
- PixmapPtr pPixmap;
-- int datasize;
-- int paddedWidth;
-+ size_t datasize;
-+ size_t paddedWidth;
- int ipad=INTER_PLANES*2 - 1;
-
- paddedWidth = PixmapBytePad(width, depth);
- paddedWidth = (paddedWidth + ipad) & ~ipad;
-+ if (paddedWidth / 4 > 32767 || height > 32767)
-+ return NullPixmap;
- datasize = height * paddedWidth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
---- programs/Xserver/mfb/mfbpixmap.c.orig Fri Nov 14 17:48:57 2003
-+++ programs/Xserver/mfb/mfbpixmap.c Sun Sep 18 04:56:02 2005
-@@ -72,12 +72,14 @@
- int depth;
- {
- PixmapPtr pPixmap;
-- int datasize;
-- int paddedWidth;
-+ size_t datasize;
-+ size_t paddedWidth;
-
- if (depth != 1)
- return NullPixmap;
- paddedWidth = BitmapBytePad(width);
-+ if (paddedWidth / 4 > 32767 || height > 32767)
-+ return NullPixmap;
- datasize = height * paddedWidth;
- pPixmap = AllocatePixmap(pScreen, datasize);
- if (!pPixmap)
diff --git a/x11/XFree86-libs/patches/patch-au b/x11/XFree86-libs/patches/patch-au
deleted file mode 100644
index b83a72e8968..00000000000
--- a/x11/XFree86-libs/patches/patch-au
+++ /dev/null
@@ -1,106 +0,0 @@
-$NetBSD: patch-au,v 1.4 2006/09/04 20:48:04 adrianp Exp $
-
-Security fix for SA21446, adapted from X.org.
-
---- lib/font/bitmap/pcfread.c.orig 2003-11-18 02:17:04.000000000 +0100
-+++ lib/font/bitmap/pcfread.c 2006-08-22 16:31:30.000000000 +0200
-@@ -32,6 +32,8 @@ from The Open Group.
- * Author: Keith Packard, MIT X Consortium
- */
-
-+#include <stdint.h>
-+
- #include "fntfilst.h"
- #include "bitmap.h"
- #include "pcf.h"
-@@ -129,6 +131,10 @@ pcfReadTOC(FontFilePtr file, int *countp
- return (PCFTablePtr) NULL;
- count = pcfGetLSB32(file);
- if (IS_EOF(file)) return (PCFTablePtr) NULL;
-+ if (count < 0 || count > INT32_MAX / sizeof(PCFTableRec)) {
-+ pcfError("pcfReadTOC(): invalid file format\n");
-+ return NULL;
-+ }
- tables = (PCFTablePtr) xalloc(count * sizeof(PCFTableRec));
- if (!tables) {
- pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec));
-@@ -248,6 +254,10 @@ pcfGetProperties(FontInfoPtr pFontInfo,
- if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT))
- goto Bail;
- nprops = pcfGetINT32(file, format);
-+ if (nprops <= 0 || nprops > INT32_MAX / sizeof(FontPropRec)) {
-+ pcfError("pcfGetProperties(): invalid nprops value (%d)\n", nprops);
-+ goto Bail;
-+ }
- if (IS_EOF(file)) goto Bail;
- props = (FontPropPtr) xalloc(nprops * sizeof(FontPropRec));
- if (!props) {
-@@ -263,6 +273,13 @@ pcfGetProperties(FontInfoPtr pFontInfo,
- props[i].name = pcfGetINT32(file, format);
- isStringProp[i] = pcfGetINT8(file, format);
- props[i].value = pcfGetINT32(file, format);
-+ if (props[i].name < 0
-+ || (isStringProp[i] != 0 && isStringProp[i] != 1)
-+ || (isStringProp[i] && props[i].value < 0)) {
-+ pcfError("pcfGetProperties(): invalid file format %d %d %d\n",
-+ props[i].name, isStringProp[i], props[i].value);
-+ goto Bail;
-+ }
- if (IS_EOF(file)) goto Bail;
- }
- /* pad the property array */
-@@ -278,6 +295,7 @@ pcfGetProperties(FontInfoPtr pFontInfo,
- }
- if (IS_EOF(file)) goto Bail;
- string_size = pcfGetINT32(file, format);
-+ if (string_size < 0) goto Bail;
- if (IS_EOF(file)) goto Bail;
- strings = (char *) xalloc(string_size);
- if (!strings) {
-@@ -418,6 +436,10 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
- else
- nmetrics = pcfGetINT16(file, format);
- if (IS_EOF(file)) goto Bail;
-+ if (nmetrics < 0 || nmetrics > INT32_MAX / sizeof(CharInfoRec)) {
-+ pcfError("pcfReadFont(): invalid file format\n");
-+ goto Bail;
-+ }
- metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec));
- if (!metrics) {
- pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec));
-@@ -443,7 +465,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
- nbitmaps = pcfGetINT32(file, format);
- if (nbitmaps != nmetrics || IS_EOF(file))
- goto Bail;
--
-+ /* nmetrics is already ok, so nbitmap also is */
- offsets = (CARD32 *) xalloc(nbitmaps * sizeof(CARD32));
- if (!offsets) {
- pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n", nbitmaps, sizeof(CARD32));
-@@ -457,6 +479,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
- for (i = 0; i < GLYPHPADOPTIONS; i++) {
- bitmapSizes[i] = pcfGetINT32(file, format);
- if (IS_EOF(file)) goto Bail;
-+ if (bitmapSizes[i] < 0) goto Bail;
- }
-
- sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)];
-@@ -532,6 +555,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
- if (IS_EOF(file)) goto Bail;
- if (nink_metrics != nmetrics)
- goto Bail;
-+ /* nmetrics already checked */
- ink_metrics = (xCharInfo *) xalloc(nink_metrics * sizeof(xCharInfo));
- if (!ink_metrics) {
- pcfError("pcfReadFont(): Couldn't allocate ink_metrics (%d*%d)\n", nink_metrics, sizeof(xCharInfo));
-@@ -805,6 +829,10 @@ pmfReadFont(FontPtr pFont, FontFilePtr f
- else
- nmetrics = pcfGetINT16(file, format);
- if (IS_EOF(file)) goto Bail;
-+ if (nmetrics < 0 || nmetrics > INT32_MAX / sizeof(CharInfoRec)) {
-+ pcfError("pmfReadFont(): invalid file format\n");
-+ goto Bail;
-+ }
- metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec));
- if (!metrics) {
- pcfError("pmfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec));
diff --git a/x11/XFree86-libs/patches/patch-av b/x11/XFree86-libs/patches/patch-av
deleted file mode 100644
index 64232e7be70..00000000000
--- a/x11/XFree86-libs/patches/patch-av
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-av,v 1.3 2006/09/16 08:28:36 adrianp Exp $
-
---- lib/font/Type1/afm.c.orig 2001-08-27 20:49:52.000000000 +0100
-+++ lib/font/Type1/afm.c
-@@ -30,6 +30,8 @@
- #include "fontmisc.h" /* for xalloc/xfree */
- #include "AFM.h"
-
-+#include <limits.h>
-+
- #define PBUF 256
- #define KBUF 20
-
-@@ -111,6 +113,11 @@ int CIDAFM(FILE *fd, FontInfo **pfi) {
-
- fi->nChars = atoi(p);
-
-+ if (fi->nChars < 0 || fi->nChars > INT_MAX / sizeof(Metrics)) {
-+ xfree(afmbuf);
-+ xfree(fi);
-+ return(1);
-+ }
- fi->metrics = (Metrics *)xalloc(fi->nChars *
- sizeof(Metrics));
- if (fi->metrics == NULL) {
diff --git a/x11/XFree86-libs/patches/patch-aw b/x11/XFree86-libs/patches/patch-aw
deleted file mode 100644
index 7708823991c..00000000000
--- a/x11/XFree86-libs/patches/patch-aw
+++ /dev/null
@@ -1,51 +0,0 @@
-$NetBSD: patch-aw,v 1.3 2006/09/16 08:28:36 adrianp Exp $
-
---- lib/font/Type1/scanfont.c.orig 2003-11-29 04:55:28.000000000 +0000
-+++ lib/font/Type1/scanfont.c
-@@ -64,6 +64,8 @@
- #include "spaces.h"
- #include "fontfcn.h"
- #include "blues.h"
-+
-+#include <limits.h>
-
- #ifdef BUILDCID
- #define CID_BUFSIZE 80
-@@ -646,6 +648,7 @@ getFDArray(psobj *arrayP)
- arrayP->data.valueP = tokenStartP;
-
- /* allocate FDArray */
-+ /* No integer overflow since arrayP->len is unsigned short */
- FDArrayP = (psfont *)vm_alloc(arrayP->len*(sizeof(psfont)));
- if (!(FDArrayP)) return(SCAN_OUT_OF_MEMORY);
-
-@@ -842,7 +845,8 @@ BuildSubrs(psfont *FontP)
- }
- return(SCAN_OK);
- }
--
-+ if (N > INT_MAX / sizeof(psobj))
-+ return (SCAN_ERROR);
- arrayP = (psobj *)vm_alloc(N*sizeof(psobj));
- if (!(arrayP) ) return(SCAN_OUT_OF_MEMORY);
- FontP->Subrs.len = N;
-@@ -903,7 +907,7 @@ BuildCharStrings(psfont *FontP)
- }
- else return(rc); /* if next token was not an Int */
- }
-- if (N<=0) return(SCAN_ERROR);
-+ if (N<=0 || N > INT_MAX / sizeof(psdict)) return(SCAN_ERROR);
- /* save number of entries in the dictionary */
-
- dictP = (psdict *)vm_alloc((N+1)*sizeof(psdict));
-@@ -1711,6 +1715,10 @@ scan_cidfont(cidfont *CIDFontP, cmapres
- if (tokenType == TOKEN_INTEGER)
- rangecnt = tokenValue.integer;
-
-+ if (rangecnt < 0 || rangecnt > INT_MAX / sizeof(spacerangecode)) {
-+ rc = SCAN_ERROR;
-+ break;
-+ }
- /* ==> tokenLength, tokenTooLong, tokenType, and */
- /* tokenValue are now set */
-
diff --git a/x11/XFree86-libs/patches/patch-ax b/x11/XFree86-libs/patches/patch-ax
deleted file mode 100644
index c84df7fa585..00000000000
--- a/x11/XFree86-libs/patches/patch-ax
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ax,v 1.3 2006/09/16 08:28:36 adrianp Exp $
-
---- lib/font/Type1/util.c.orig 2001-01-17 19:43:24.000000000 +0000
-+++ lib/font/Type1/util.c
-@@ -97,7 +97,7 @@ vm_alloc(int bytes)
- bytes = (bytes + 7) & ~7;
-
- /* Allocate the space, if it is available */
-- if (bytes <= vm_free) {
-+ if (bytes > 0 && bytes <= vm_free) {
- answer = vm_next;
- vm_free -= bytes;
- vm_next += bytes;