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 | |
parent | ee452992357329f7af846eba8f5bbe61c5d27bfa (diff) |
merge XFree86 4.3.0.1 to -CURRENT
-rw-r--r-- | include/X11/ICE/ICElib.h | 1 | ||||
-rw-r--r-- | include/X11/ICE/ICEmsg.h | 7 | ||||
-rw-r--r-- | include/X11/ICE/ICEutil.h | 7 | ||||
-rw-r--r-- | src/ICElibint.h | 25 | ||||
-rw-r--r-- | src/authutil.c | 17 | ||||
-rw-r--r-- | src/connect.c | 34 | ||||
-rw-r--r-- | src/error.c | 11 | ||||
-rw-r--r-- | src/getauth.c | 3 | ||||
-rw-r--r-- | src/globals.h | 9 | ||||
-rw-r--r-- | src/iceauth.c | 9 | ||||
-rw-r--r-- | src/listenwk.c | 1 | ||||
-rw-r--r-- | src/misc.c | 4 | ||||
-rw-r--r-- | src/process.c | 128 | ||||
-rw-r--r-- | src/protosetup.c | 3 | ||||
-rw-r--r-- | src/setauth.c | 5 | ||||
-rw-r--r-- | src/shutdown.c | 2 |
16 files changed, 161 insertions, 105 deletions
diff --git a/include/X11/ICE/ICElib.h b/include/X11/ICE/ICElib.h index 5385bf0..799899f 100644 --- a/include/X11/ICE/ICElib.h +++ b/include/X11/ICE/ICElib.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/ICElib.h,v 3.4 2001/12/14 19:53:35 dawes Exp $ */ #ifndef _ICELIB_H_ #define _ICELIB_H_ diff --git a/include/X11/ICE/ICEmsg.h b/include/X11/ICE/ICEmsg.h index 99976b5..94b1a00 100644 --- a/include/X11/ICE/ICEmsg.h +++ b/include/X11/ICE/ICEmsg.h @@ -26,12 +26,17 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/ICEmsg.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */ #ifndef _ICEMSG_H_ #define _ICEMSG_H_ +#include <X11/Xfuncproto.h> + #include <X11/ICE/ICEconn.h> +_XFUNCPROTOBEGIN + /* * Function prototypes for internal ICElib functions */ @@ -299,4 +304,6 @@ extern void _IceErrorBadValue ( _IceRead (_iceConn, (unsigned long) (_bytes), _dummy); \ } +_XFUNCPROTOEND + #endif /* _ICEMSG_H_ */ diff --git a/include/X11/ICE/ICEutil.h b/include/X11/ICE/ICEutil.h index 0784a66..6b76b94 100644 --- a/include/X11/ICE/ICEutil.h +++ b/include/X11/ICE/ICEutil.h @@ -26,13 +26,18 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/ICEutil.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */ #ifndef _ICEUTIL_H_ #define _ICEUTIL_H_ +#include <X11/Xfuncproto.h> + #include <stdio.h> #include <X11/Xlib.h> +_XFUNCPROTOBEGIN + /* * Data structure for entry in ICE authority file */ @@ -135,4 +140,6 @@ extern void IceSetPaAuthData ( #endif ); +_XFUNCPROTOEND + #endif /* _ICEUTIL_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 <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); \ } diff --git a/src/authutil.c b/src/authutil.c index 64ad848..abdbf44 100644 --- a/src/authutil.c +++ b/src/authutil.c @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/authutil.c,v 3.9 2002/05/31 18:45:41 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" @@ -34,14 +35,11 @@ Author: Ralph Mor, X Consortium #include <sys/stat.h> #include <errno.h> -#ifdef X_NOT_STDC_ENV -extern int errno; -extern long time (); -extern char *getenv(); -#define Time_t long -#else #include <time.h> #define Time_t time_t +#ifdef __UNIXOS2__ +extern char* getenv(const char*); +#define link rename #endif #ifndef X_NOT_POSIX #include <unistd.h> @@ -77,7 +75,7 @@ IceAuthFileName () static char *buf; static int bsize; int size; -#ifdef WIN32 +#if defined(WIN32) || defined(__UNIXOS2__) #ifndef PATH_MAX #define PATH_MAX 512 #endif @@ -109,6 +107,11 @@ IceAuthFileName () } if (!name) #endif +#ifdef __UNIXOS2__ + strcpy (dir,"c:"); + name = dir; + if (!name) +#endif return (NULL); } diff --git a/src/connect.c b/src/connect.c index 57ee86a..2070ece 100644 --- a/src/connect.c +++ b/src/connect.c @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/connect.c,v 3.10 2002/12/02 21:50:29 tsi Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" @@ -34,23 +35,7 @@ Author: Ralph Mor, X Consortium static XtransConnInfo ConnectToPeer(); -#ifndef X_NOT_STDC_ENV #define Strstr strstr -#else -static char *Strstr(s1, s2) - char *s1, *s2; -{ - int n1, n2; - - n1 = strlen(s1); - n2 = strlen(s2); - for ( ; n1 >= n2; s1++, n1--) { - if (!strncmp(s1, s2, n2)) - return s1; - } - return NULL; -} -#endif IceConn IceOpenConnection (networkIdsList, context, mustAuthenticate, majorOpcodeCheck, @@ -220,7 +205,7 @@ char *errorStringRet; iceConn->inbufmax = iceConn->inbuf + ICE_INBUFSIZE; if ((iceConn->outbuf = iceConn->outbufptr = - (char *) malloc (ICE_OUTBUFSIZE)) == NULL) + (char *) calloc (1, ICE_OUTBUFSIZE)) == NULL) { _IceFreeConnection (iceConn); strncpy (errorStringRet, "Can't malloc", errorLength); @@ -473,6 +458,7 @@ char **actualConnectionRet; int madeConnection = 0; int len, retry; int connect_stat; + int address_size; XtransConnInfo trans_conn = NULL; *actualConnectionRet = NULL; @@ -481,8 +467,16 @@ char **actualConnectionRet; len = strlen (networkIdsList); endptr = networkIdsList + len; - if (len < sizeof addrbuf) address = addrbuf; - else address = malloc (len + 1); + if (len < sizeof addrbuf) + { + address = addrbuf; + address_size = 256; + } + else + { + address = malloc (len + 1); + address_size = len; + } while (ptr < endptr && !madeConnection) { @@ -490,6 +484,8 @@ char **actualConnectionRet; delim = endptr; len = delim - ptr; + if (len > address_size - 1) + len = address_size - 1; strncpy (address, ptr, len); address[len] = '\0'; diff --git a/src/error.c b/src/error.c index 6caf66f..b9f527a 100644 --- a/src/error.c +++ b/src/error.c @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/error.c,v 1.6 2001/12/14 19:53:35 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" @@ -33,10 +34,6 @@ Author: Ralph Mor, X Consortium #include <errno.h> -#ifdef X_NOT_STDC_ENV -extern int errno; -#endif - void _IceErrorBadMinor (iceConn, majorOpcode, offendingMinor, severity) @@ -428,7 +425,7 @@ IcePointer values; fprintf (stderr, "ICE error: Offending minor opcode = %d (%s)\n", offendingMinorOpcode, str); - fprintf (stderr, " Offending sequence number = %d\n", + fprintf (stderr, " Offending sequence number = %lu\n", offendingSequence); switch (errorClass) @@ -609,8 +606,8 @@ IceConn iceConn; { fprintf (stderr, - "ICE default IO error handler doing an exit(), pid = %d, errno = %d\n", - getpid(), errno); + "ICE default IO error handler doing an exit(), pid = %ld, errno = %d\n", + (long)getpid(), errno); exit (1); } diff --git a/src/getauth.c b/src/getauth.c index 50024bd..9c3e52a 100644 --- a/src/getauth.c +++ b/src/getauth.c @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/getauth.c,v 1.3 2001/12/14 19:53:35 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" @@ -98,7 +99,7 @@ unsigned short *authDataLenRet; char **authDataRet; { - IceAuthDataEntry *entry; + IceAuthDataEntry *entry = NULL; int found = 0; int i; diff --git a/src/globals.h b/src/globals.h index 6bffe7c..129bf00 100644 --- a/src/globals.h +++ b/src/globals.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/globals.h,v 1.5 2002/05/31 18:45:41 dawes Exp $ */ extern void _IceDefaultErrorHandler (); extern void _IceDefaultIOErrorHandler (); @@ -35,11 +36,17 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc (); extern void _IceProcessCoreMessage (); +#ifndef __UNIXOS2__ IceConn _IceConnectionObjs[256]; char *_IceConnectionStrings[256]; +_IceProtocol _IceProtocols[255]; +#else +IceConn _IceConnectionObjs[256] = {0}; +char *_IceConnectionStrings[256] = {0}; +_IceProtocol _IceProtocols[255] = {0}; +#endif int _IceConnectionCount = 0; -_IceProtocol _IceProtocols[255]; int _IceLastMajorOpcode = 0; int _IceAuthCount = 1; diff --git a/src/iceauth.c b/src/iceauth.c index 4556b9a..d03cf25 100644 --- a/src/iceauth.c +++ b/src/iceauth.c @@ -26,18 +26,14 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/iceauth.c,v 3.6 2002/05/31 18:45:41 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" #include <X11/ICE/ICEutil.h> -#ifdef X_NOT_STDC_ENV -#define Time_t long -extern Time_t time (); -#else #include <time.h> #define Time_t time_t -#endif static int binaryEqual (); @@ -73,8 +69,9 @@ int len; } #else { +#ifndef __UNIXOS2__ long time (); - +#endif ldata[0] = time ((long *) 0); ldata[1] = getpid (); } diff --git a/src/listenwk.c b/src/listenwk.c index 156fc61..f01cb14 100644 --- a/src/listenwk.c +++ b/src/listenwk.c @@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/lib/ICE/listenwk.c,v 1.4 2001/12/14 19:53:36 dawes Exp $ */ /* Author: Ralph Mor, X Consortium */ @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/misc.c,v 1.4 2001/12/14 19:53:36 dawes Exp $ */ #ifdef WIN32 #define _WILLWINSOCK_ @@ -69,8 +70,9 @@ unsigned long size; * Output/Input buffer functions */ +int IceFlush (iceConn) - + IceConn iceConn; { diff --git a/src/process.c b/src/process.c index 159348d..0136f41 100644 --- a/src/process.c +++ b/src/process.c @@ -26,10 +26,12 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/process.c,v 3.8 2001/12/14 19:53:36 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" +#include <stdio.h> /* sprintf */ /* * Check for bad length @@ -58,7 +60,11 @@ Author: Ralph Mor, X Consortium return (0); \ } - +#define BAIL_STRING(_iceConn, _opcode, _pStart) {\ + _IceErrorBadLength (_iceConn, 0, _opcode, IceFatalToConnection);\ + IceDisposeCompleteMessage (_iceConn, _pStart);\ + return (0);\ +} /* * IceProcessMessages: @@ -194,7 +200,7 @@ Bool *replyReadyRet; { iceConn->swap = (((*(char *) &endian) && byteOrder == IceMSBfirst) || - !(*(char *) &endian) && byteOrder == IceLSBfirst); + (!(*(char *) &endian) && byteOrder == IceLSBfirst)); iceConn->waiting_for_byteorder = 0; } @@ -534,7 +540,7 @@ Bool swap; IceReplyWaitInfo *replyWait; { - int invokeHandler; + int invokeHandler = 0; Bool errorReturned = False; iceErrorMsg *message; char *pData, *pStart; @@ -761,8 +767,8 @@ IceReplyWaitInfo *replyWait; if (iceConn->connect_to_you && iceConn->connect_to_you->auth_active) { - authProc = _IcePoAuthProcs[ - iceConn->connect_to_you->my_auth_index]; + authProc = _IcePoAuthProcs[(int) + (iceConn->connect_to_you->my_auth_index)]; (*authProc) (iceConn, &iceConn->connect_to_you->my_auth_state, True /* clean up */, False /* swap */, @@ -774,8 +780,8 @@ IceReplyWaitInfo *replyWait; _IcePoProtocol *protocol = _IceProtocols[ iceConn->protosetup_to_you->my_opcode - 1].orig_client; - authProc = protocol->auth_procs[iceConn-> - protosetup_to_you->my_auth_index]; + authProc = protocol->auth_procs[(int)(iceConn-> + protosetup_to_you->my_auth_index)]; (*authProc) (iceConn, &iceConn->protosetup_to_you->my_auth_state, @@ -799,7 +805,7 @@ IceReplyWaitInfo *replyWait; -static +static int ProcessConnectionSetup (iceConn, length, swap) IceConn iceConn; @@ -813,8 +819,8 @@ Bool swap; int hisMajorVersion, hisMinorVersion; int myAuthCount, hisAuthCount; int found, i, j; - char *myAuthName, **hisAuthNames; - char *pData, *pStart; + char *myAuthName, **hisAuthNames = NULL; + char *pData, *pStart, *pEnd; char *vendor = NULL; char *release = NULL; int myAuthIndex = 0; @@ -838,10 +844,18 @@ Bool swap; } pData = pStart; - - SKIP_STRING (pData, swap); /* vendor */ - SKIP_STRING (pData, swap); /* release */ - SKIP_LISTOF_STRING (pData, swap, (int) message->authCount);/* auth names */ + pEnd = pStart + (length << 3); + + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING(iceConn, ICE_ConnectionSetup, + pStart)); /* vendor */ + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING(iceConn, ICE_ConnectionSetup, + pStart)); /* release */ + SKIP_LISTOF_STRING (pData, swap, (int) message->authCount, pEnd, + BAIL_STRING(iceConn, ICE_ConnectionSetup, + pStart)); /* auth names */ + pData += (message->versionCount * 4); /* versions */ CHECK_COMPLETE_SIZE (iceConn, ICE_ConnectionSetup, @@ -1064,7 +1078,7 @@ IceReplyWaitInfo *replyWait; IcePoAuthProc authProc; IcePoAuthStatus status; IcePointer authState; - int realAuthIndex; + int realAuthIndex = 0; CHECK_AT_LEAST_SIZE (iceConn, ICE_AuthRequired, length, SIZEOF (iceAuthRequiredMsg), @@ -1241,7 +1255,7 @@ IceReplyWaitInfo *replyWait; -static +static int ProcessAuthReply (iceConn, length, swap) IceConn iceConn; @@ -1282,8 +1296,8 @@ Bool swap; if (iceConn->connect_to_me) { - IcePaAuthProc authProc = _IcePaAuthProcs[ - iceConn->connect_to_me->my_auth_index]; + IcePaAuthProc authProc = _IcePaAuthProcs[(int) + (iceConn->connect_to_me->my_auth_index)]; IcePaAuthStatus status = (*authProc) (iceConn, &iceConn->connect_to_me->my_auth_state, swap, replyDataLen, replyData, &authDataLen, &authData, &errorString); @@ -1354,8 +1368,8 @@ Bool swap; { _IcePaProtocol *myProtocol = _IceProtocols[iceConn->protosetup_to_me-> my_opcode - 1].accept_client; - IcePaAuthProc authProc = myProtocol->auth_procs[ - iceConn->protosetup_to_me->my_auth_index]; + IcePaAuthProc authProc = myProtocol->auth_procs[(int) + (iceConn->protosetup_to_me->my_auth_index)]; IcePaAuthStatus status = (*authProc) (iceConn, &iceConn->protosetup_to_me->my_auth_state, swap, replyDataLen, replyData, @@ -1580,8 +1594,8 @@ IceReplyWaitInfo *replyWait; if (iceConn->connect_to_you) { - authProc = _IcePoAuthProcs[ - iceConn->connect_to_you->my_auth_index]; + authProc = _IcePoAuthProcs[(int) + (iceConn->connect_to_you->my_auth_index)]; authState = &iceConn->connect_to_you->my_auth_state; } @@ -1590,8 +1604,8 @@ IceReplyWaitInfo *replyWait; _IcePoProtocol *myProtocol = _IceProtocols[iceConn->protosetup_to_you->my_opcode - 1].orig_client; - authProc = myProtocol->auth_procs[ - iceConn->protosetup_to_you->my_auth_index]; + authProc = myProtocol->auth_procs[(int) + (iceConn->protosetup_to_you->my_auth_index)]; authState = &iceConn->protosetup_to_you->my_auth_state; } @@ -1620,7 +1634,7 @@ IceReplyWaitInfo *replyWait; } else if (status == IcePoAuthRejected || status == IcePoAuthFailed) { - char *prefix, *returnErrorString; + char *prefix = NULL, *returnErrorString; if (status == IcePoAuthRejected) { @@ -1680,7 +1694,7 @@ IceReplyWaitInfo *replyWait; { iceConnectionReplyMsg *message; - char *pData, *pStart; + char *pData, *pStart, *pEnd; Bool replyReady; CHECK_AT_LEAST_SIZE (iceConn, ICE_ConnectionReply, @@ -1696,9 +1710,14 @@ IceReplyWaitInfo *replyWait; } pData = pStart; + pEnd = pStart + (length << 3); - SKIP_STRING (pData, swap); /* vendor */ - SKIP_STRING (pData, swap); /* release */ + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING (iceConn, ICE_ConnectionReply, + pStart)); /* vendor */ + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING (iceConn, ICE_ConnectionReply, + pStart)); /* release */ CHECK_COMPLETE_SIZE (iceConn, ICE_ConnectionReply, length, pData - pStart + SIZEOF (iceConnectionReplyMsg), @@ -1714,8 +1733,8 @@ IceReplyWaitInfo *replyWait; * Tell the authentication procedure to clean up. */ - IcePoAuthProc authProc = _IcePoAuthProcs[ - iceConn->connect_to_you->my_auth_index]; + IcePoAuthProc authProc = _IcePoAuthProcs[(int) + (iceConn->connect_to_you->my_auth_index)]; (*authProc) (iceConn, &iceConn->connect_to_you->my_auth_state, True /* clean up */, False /* swap */, @@ -1766,7 +1785,7 @@ IceReplyWaitInfo *replyWait; -static +static int ProcessProtocolSetup (iceConn, length, swap) IceConn iceConn; @@ -1782,9 +1801,9 @@ Bool swap; int myAuthCount, hisAuthCount; int myOpcode, hisOpcode; int found, i, j; - char *myAuthName, **hisAuthNames; + char *myAuthName, **hisAuthNames = NULL; char *protocolName; - char *pData, *pStart; + char *pData, *pStart, *pEnd; char *vendor = NULL; char *release = NULL; int accept_setup_now = 0; @@ -1819,11 +1838,20 @@ Bool swap; } pData = pStart; - - SKIP_STRING (pData, swap); /* proto name */ - SKIP_STRING (pData, swap); /* vendor */ - SKIP_STRING (pData, swap); /* release */ - SKIP_LISTOF_STRING (pData, swap, (int) message->authCount);/* auth names */ + pEnd = pStart + (length << 3); + + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING(iceConn, ICE_ProtocolSetup, + pStart)); /* proto name */ + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING(iceConn, ICE_ProtocolSetup, + pStart)); /* vendor */ + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING(iceConn, ICE_ProtocolSetup, + pStart)); /* release */ + SKIP_LISTOF_STRING (pData, swap, (int) message->authCount, pEnd, + BAIL_STRING(iceConn, ICE_ProtocolSetup, + pStart)); /* auth names */ pData += (message->versionCount * 4); /* versions */ CHECK_COMPLETE_SIZE (iceConn, ICE_ProtocolSetup, @@ -2165,7 +2193,7 @@ IceReplyWaitInfo *replyWait; { iceProtocolReplyMsg *message; - char *pData, *pStart; + char *pData, *pStart, *pEnd; Bool replyReady; CHECK_AT_LEAST_SIZE (iceConn, ICE_ProtocolReply, @@ -2181,9 +2209,14 @@ IceReplyWaitInfo *replyWait; } pData = pStart; + pEnd = pStart + (length << 3); - SKIP_STRING (pData, swap); /* vendor */ - SKIP_STRING (pData, swap); /* release */ + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING(iceConn, ICE_ProtocolReply, + pStart)); /* vendor */ + SKIP_STRING (pData, swap, pEnd, + BAIL_STRING(iceConn, ICE_ProtocolReply, + pStart)); /* release */ CHECK_COMPLETE_SIZE (iceConn, ICE_ProtocolReply, length, pData - pStart + SIZEOF (iceProtocolReplyMsg), @@ -2202,8 +2235,8 @@ IceReplyWaitInfo *replyWait; _IcePoProtocol *myProtocol = _IceProtocols[ iceConn->protosetup_to_you->my_opcode - 1].orig_client; - IcePoAuthProc authProc = myProtocol->auth_procs[ - iceConn->protosetup_to_you->my_auth_index]; + IcePoAuthProc authProc = myProtocol->auth_procs[(int) + (iceConn->protosetup_to_you->my_auth_index)]; #ifdef SVR4 @@ -2263,7 +2296,7 @@ IceReplyWaitInfo *replyWait; -static +static int ProcessPing (iceConn, length) IceConn iceConn; @@ -2280,7 +2313,7 @@ unsigned long length; -static +static int ProcessPingReply (iceConn, length) IceConn iceConn; @@ -2310,7 +2343,7 @@ unsigned long length; -static +static int ProcessWantToClose (iceConn, length, connectionClosedRet) IceConn iceConn; @@ -2370,7 +2403,7 @@ Bool *connectionClosedRet; -static +static int ProcessNoClose (iceConn, length) IceConn iceConn; @@ -2488,3 +2521,4 @@ Bool *connectionClosedRet; if (replyWait) *replyReadyRet = replyReady; } + diff --git a/src/protosetup.c b/src/protosetup.c index 78be316..287932a 100644 --- a/src/protosetup.c +++ b/src/protosetup.c @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/protosetup.c,v 1.3 2001/12/14 19:53:36 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" @@ -58,7 +59,7 @@ char *errorStringRet; unsigned long setup_sequence; IceReplyWaitInfo replyWait; _IceReply reply; - IcePoVersionRec *versionRec; + IcePoVersionRec *versionRec = NULL; int authCount; int *authIndices; diff --git a/src/setauth.c b/src/setauth.c index 5df13ec..48b4d3a 100644 --- a/src/setauth.c +++ b/src/setauth.c @@ -26,6 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/setauth.c,v 1.5 2002/05/31 18:45:41 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" @@ -48,7 +49,11 @@ Author: Ralph Mor, X Consortium */ int _IcePaAuthDataEntryCount = 0; +#ifndef __UNIXOS2__ IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES]; +#else +IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES] = {0}; +#endif void diff --git a/src/shutdown.c b/src/shutdown.c index 94a7eb9..8b52418 100644 --- a/src/shutdown.c +++ b/src/shutdown.c @@ -26,9 +26,11 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ +/* $XFree86: xc/lib/ICE/shutdown.c,v 3.4 2001/12/14 19:53:36 dawes Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" +#include <X11/Xtrans.h> Status |