From a4b29bd17ae57f76103d2aeb90659560741a67b9 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Mon, 17 Nov 2003 19:03:40 +0000 Subject: merge XFree86 4.3.0.1 to -CURRENT --- src/ICElibint.h | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/ICElibint.h') 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 #include -#ifndef X_NOT_STDC_ENV #include -#else -char *malloc(); -#endif - -#ifndef NULL -#define NULL 0 -#endif +#include /* @@ -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); \ } -- cgit v1.2.3