summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2005-03-21 04:58:21 +0000
committerAlan Coopersmith <alan.coopersmith@sun.com>2005-03-21 04:58:21 +0000
commit6769ccda88caf27d1441d335ef2b318a047a612b (patch)
treef8324ca9353163cc43d0fdd16e53031ec8809908
parent3b9e8ece93b916c55a82df53e85f097418edf471 (diff)
downloadxorg-lib-libX11-6769ccda88caf27d1441d335ef2b318a047a612b.tar.gz
xc/lib/X11/ErrDes.cXORG-6_8_99_6
//bugs.freedesktop.org/show_bug.cgi?id=132) Patch #2168 (https://bugs.freedesktop.org/attachment.cgi?id=2168) Replace a couple of BUFSIZE uses with better values to check against. Fixes by Stuart Anderson <anderson@netsweng.com>
-rw-r--r--src/ErrDes.c3
-rw-r--r--src/xkb/XKBSetGeom.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/ErrDes.c b/src/ErrDes.c
index 9f9656a1..2f1e1de4 100644
--- a/src/ErrDes.c
+++ b/src/ErrDes.c
@@ -1,5 +1,6 @@
/*
* $Xorg: ErrDes.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $
+ * $XdotOrg: lib/X11/src/ErrDes.c,v 1.5 2005-03-21 04:58:21 alanc Exp $
*/
/***********************************************************
@@ -173,7 +174,7 @@ XGetErrorDatabaseText(
if (db)
{
tlen = strlen (name) + strlen (type) + 2;
- if (tlen <= BUFSIZE)
+ if (tlen <= sizeof(temp))
tptr = temp;
else
tptr = Xmalloc (tlen);
diff --git a/src/xkb/XKBSetGeom.c b/src/xkb/XKBSetGeom.c
index 460594fa..148e5e54 100644
--- a/src/xkb/XKBSetGeom.c
+++ b/src/xkb/XKBSetGeom.c
@@ -1,4 +1,5 @@
/* $Xorg: XKBSetGeom.c,v 1.3 2000/08/17 19:45:03 cpqbld Exp $ */
+/* $XdotOrg: lib/X11/src/xkb/XKBSetGeom.c,v 1.3 2005-03-21 04:58:21 alanc Exp $ */
/************************************************************
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
@@ -400,7 +401,7 @@ char * wire,*tbuf;
sz+= _SizeGeomDoodads(geom->num_doodads,geom->doodads);
sz+= _SizeGeomKeyAliases(geom);
req->length+= (sz/4);
- if (sz<BUFSIZE) {
+ if (sz < (dpy->bufmax - dpy->buffer)) {
BufAlloc(char *,wire,sz);
tbuf= NULL;
}