From a610b36a42a33cd93d1513d20fb834d26248819b Mon Sep 17 00:00:00 2001 From: Roland Mainz Date: Mon, 13 Dec 2004 02:31:19 +0000 Subject: [PATCH] //bugs.freedesktop.org/show_bug.cgi?id=1864) attachment #1310 (https://bugs.freedesktop.org/attachment.cgi?id=1310): Fix random crashes because |pbuf| variable is not initialized in |_XFopenFile| (later the pointer is checked for |NULL| and freed otherwise. If the file was not found the pointer is uninitialized and rando memory is freed). Patch by Alexander Gottwald --- src/XlibInt.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/XlibInt.c b/src/XlibInt.c index 17ed4cce..b9da8d72 100644 --- a/src/XlibInt.c +++ b/src/XlibInt.c @@ -35,17 +35,11 @@ from The Open Group. #define NEED_EVENTS #define NEED_REPLIES -#ifdef WIN32 -#define _XLIBINT_ -#endif #include "Xlibint.h" #include #include #include #include -#ifdef WIN32 -#include -#endif #ifdef XTHREADS #include "locking.h" @@ -3352,7 +3346,7 @@ int _XOpenFile(path, flags) int flags; { char buf[MAX_PATH]; - char* bufp = NULL; + char* bufp; int ret = -1; UINT olderror = SetErrorMode (SEM_FAILCRITICALERRORS); @@ -3404,23 +3398,3 @@ int _XAccessFile(path) #endif -#ifdef WIN32 -#undef _Xdebug -int _Xdebug = 0; -int *_Xdebug_p = &_Xdebug; -void (**_XCreateMutex_fn_p)(LockInfoPtr) = &_XCreateMutex_fn; -void (**_XFreeMutex_fn_p)(LockInfoPtr) = &_XFreeMutex_fn; -void (**_XLockMutex_fn_p)(LockInfoPtr -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = &_XLockMutex_fn; -void (**_XUnlockMutex_fn_p)(LockInfoPtr -#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) - , char * /* file */ - , int /* line */ -#endif - ) = &_XUnlockMutex_fn; -LockInfoPtr *_Xglobal_lock_p = &_Xglobal_lock; -#endif