Commit 6769ccda authored by Alan Coopersmith's avatar Alan Coopersmith

xc/lib/X11/ErrDes.c

//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>
parent 3b9e8ece
/*
* $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);
......
/* $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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment