diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-13 02:31:19 +0000 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2004-12-13 02:31:19 +0000 |
commit | a610b36a42a33cd93d1513d20fb834d26248819b (patch) | |
tree | c6579539f10fa350498abec7b520e8754aaec80b | |
parent | af2711c531b7c033c11ad215537873e73e4ebd23 (diff) | |
download | xorg-lib-libX11-a610b36a42a33cd93d1513d20fb834d26248819b.tar.gz |
//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 <ago@freedesktop.org>
-rw-r--r-- | src/XlibInt.c | 28 |
1 files changed, 1 insertions, 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 <X11/Xpoll.h> #include <X11/Xtrans.h> #include <X11/extensions/xcmiscstr.h> #include <stdio.h> -#ifdef WIN32 -#include <direct.h> -#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 |