head	1.4;
access;
symbols
	pkgsrc-2013Q2:1.4.0.32
	pkgsrc-2013Q2-base:1.4
	pkgsrc-2012Q4:1.4.0.30
	pkgsrc-2012Q4-base:1.4
	pkgsrc-2011Q4:1.4.0.28
	pkgsrc-2011Q4-base:1.4
	pkgsrc-2011Q2:1.4.0.26
	pkgsrc-2011Q2-base:1.4
	pkgsrc-2009Q4:1.4.0.24
	pkgsrc-2009Q4-base:1.4
	pkgsrc-2008Q4:1.4.0.22
	pkgsrc-2008Q4-base:1.4
	pkgsrc-2008Q3:1.4.0.20
	pkgsrc-2008Q3-base:1.4
	cube-native-xorg:1.4.0.18
	cube-native-xorg-base:1.4
	pkgsrc-2008Q2:1.4.0.16
	pkgsrc-2008Q2-base:1.4
	pkgsrc-2008Q1:1.4.0.14
	pkgsrc-2008Q1-base:1.4
	pkgsrc-2007Q4:1.4.0.12
	pkgsrc-2007Q4-base:1.4
	pkgsrc-2007Q3:1.4.0.10
	pkgsrc-2007Q3-base:1.4
	pkgsrc-2007Q2:1.4.0.8
	pkgsrc-2007Q2-base:1.4
	pkgsrc-2007Q1:1.4.0.6
	pkgsrc-2007Q1-base:1.4
	pkgsrc-2006Q4:1.4.0.4
	pkgsrc-2006Q4-base:1.4
	pkgsrc-2006Q3:1.4.0.2
	pkgsrc-2006Q3-base:1.4
	pkgsrc-2006Q2:1.3.0.16
	pkgsrc-2006Q2-base:1.3
	pkgsrc-2006Q1:1.3.0.14
	pkgsrc-2006Q1-base:1.3
	pkgsrc-2005Q4:1.3.0.12
	pkgsrc-2005Q4-base:1.3
	pkgsrc-2005Q3:1.3.0.10
	pkgsrc-2005Q3-base:1.3
	pkgsrc-2005Q2:1.3.0.8
	pkgsrc-2005Q2-base:1.3
	pkgsrc-2005Q1:1.3.0.6
	pkgsrc-2005Q1-base:1.3
	pkgsrc-2004Q4:1.3.0.4
	pkgsrc-2004Q4-base:1.3
	pkgsrc-2004Q3:1.3.0.2
	pkgsrc-2004Q3-base:1.3
	pkgsrc-2004Q2:1.2.0.2
	pkgsrc-2004Q2-base:1.2
	pkgsrc-2004Q1:1.1.1.1.0.2
	pkgsrc-2004Q1-base:1.1.1.1
	pkgsrc-base:1.1.1.1
	TNF:1.1.1;
locks; strict;
comment	@# @;


1.4
date	2006.09.27.15.18.17;	author joerg;	state dead;
branches;
next	1.3;

1.3
date	2004.09.16.19.28.56;	author minskim;	state Exp;
branches;
next	1.2;

1.2
date	2004.03.28.22.06.15;	author xtraeme;	state dead;
branches;
next	1.1;

1.1
date	2004.01.24.08.47.29;	author xtraeme;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2004.01.24.08.47.29;	author xtraeme;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Remove XFree86.
@
text
@$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;
@


1.3
log
@Incorporate libXpm security fixes of X.Org X11R6.8.1.

Bump PKGREVISION.
@
text
@d1 1
a1 1
$NetBSD$
@


1.2
log
@Upgrade XFree86 packages to 4.4.0.

To see a full list of changes, please review:
http://xfree86.org/4.4.0/RELNOTES.html

These packages has been tested under NetBSD 1.6/-current, FreeBSD 4.x/5.x,
and GNU/Linux (i386) by Jeremy C. Reed, Michal Pasternak and myself.
@
text
@d1 1
a1 1
$NetBSD: patch-am,v 1.1 2004/01/24 08:47:29 xtraeme Exp $
d3 5
a7 9
--- lib/Imakefile.orig	Sun Mar  2 19:44:29 2003
+++ lib/Imakefile	Sun Mar  2 19:44:31 2003
@@@@ -211,7 +211,7 @@@@
              $(DPSLIBDIR) $(DPSTKLIBDIR) $(PSRESLIBDIR) $(XINERAMADIR) \
              $(ZLIBDIR) $(REGEXDIR) $(RENDERLIBDIR) $(FREETYPE2BUILDDIR) \
              $(LIBXML2BUILDDIR) $(EXPATBUILDDIR) $(FONTCONFIGBUILDDIR) \
-             $(XFT1LIBDIR) $(XFTLIBDIR) $(XVMCLIBDIR) $(RANDRLIBDIR) \
+             $(XVMCLIBDIR) $(RANDRLIBDIR) \
              $(XTRAPLIBDIR) $(XRESLIBDIR) $(XCURSORLIBDIR)
d9 171
a179 1
 SUBDIRS = $(BERKDIR) xtrans $(LINTSUBDIRS) $(FONTSUBDIR) $(FONTENCSUBDIR) \
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
$NetBSD$
@


1.1.1.1
log
@Initial import of XFree86-libs-4.3.0 from pkgsrc-wip.

This package contains the XFree86 include header files and shared
library files.
@
text
@@
