//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>

This commit is contained in:
Roland Mainz 2004-12-13 02:31:19 +00:00
parent af2711c531
commit a610b36a42

View file

@ -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