diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:48:46 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:48:46 +0000 |
commit | 72e353567f8927996a26e72848d86f692c3f0737 (patch) | |
tree | b8a8241378b752cbc7ef7041ac8100fedc7239c4 /src/ICElibint.h | |
parent | ee452992357329f7af846eba8f5bbe61c5d27bfa (diff) |
XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1
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); \ } |