diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-17 19:03:40 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-17 19:03:40 +0000 |
commit | a4b29bd17ae57f76103d2aeb90659560741a67b9 (patch) | |
tree | b8a8241378b752cbc7ef7041ac8100fedc7239c4 /src/ICElibint.h | |
parent | ee452992357329f7af846eba8f5bbe61c5d27bfa (diff) |
merge XFree86 4.3.0.1 to -CURRENT
Diffstat (limited to 'src/ICElibint.h')
-rw-r--r-- | src/ICElibint.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/ICElibint.h b/src/ICElibint.h index 0a1ffcb..ab979ac 100644 --- a/src/ICElibint.h +++ b/src/ICElibint.h @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/ICElibint.h,v 1.6 2001/12/14 19:53:35 dawes Exp $ */ #ifndef _ICELIBINT_H_ #define _ICELIBINT_H_ @@ -37,15 +38,8 @@ Author: Ralph Mor, X Consortium #include <X11/ICE/ICEconn.h> #include <X11/ICE/ICEmsg.h> -#ifndef X_NOT_STDC_ENV #include <stdlib.h> -#else -char *malloc(); -#endif - -#ifndef NULL -#define NULL 0 -#endif +#include <stddef.h> /* @@ -287,20 +281,21 @@ typedef struct { } -#define SKIP_STRING(_pBuf, _swap) \ +#define SKIP_STRING(_pBuf, _swap, _end, _bail) \ { \ CARD16 _len; \ EXTRACT_CARD16 (_pBuf, _swap, _len); \ - _pBuf += _len; \ - if (PAD32 (2 + _len)) \ - _pBuf += PAD32 (2 + _len); \ -} + _pBuf += _len + PAD32(2+_len); \ + if (_pBuf > _end) { \ + _bail; \ + } \ +} -#define SKIP_LISTOF_STRING(_pBuf, _swap, _count) \ +#define SKIP_LISTOF_STRING(_pBuf, _swap, _count, _end, _bail) \ { \ int _i; \ for (_i = 0; _i < _count; _i++) \ - SKIP_STRING (_pBuf, _swap); \ + SKIP_STRING (_pBuf, _swap, _end, _bail); \ } |