glx: NULL-protect validGlxFBConfigForWindow()
If this ever happens, we clearly have a bug, so print out proper warning, instead of silently crashing the Xserver. | ../glx/glxcmds.c: In function ‘validGlxFBConfigForWindow’: | ../glx/glxcmds.c:127:16: warning: dereference of NULL ‘pVisual’ [CWE-476] [-Wanalyzer-null-dereference] | 127 | if (pVisual->class != glxConvertToXVisualType(config->visualType) || | | ~~~~~~~^~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
1e055b5ddc
commit
2274f23e60
|
@ -36,6 +36,7 @@
|
||||||
#include <X11/extensions/presenttokens.h>
|
#include <X11/extensions/presenttokens.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "os/bug_priv.h"
|
||||||
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include <unpack.h>
|
#include <unpack.h>
|
||||||
|
@ -122,6 +123,8 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BUG_RETURN_VAL(!pVisual, FALSE);
|
||||||
|
|
||||||
/* FIXME: What exactly should we check here... */
|
/* FIXME: What exactly should we check here... */
|
||||||
if (pVisual->class != glxConvertToXVisualType(config->visualType) ||
|
if (pVisual->class != glxConvertToXVisualType(config->visualType) ||
|
||||||
!(config->drawableType & GLX_WINDOW_BIT)) {
|
!(config->drawableType & GLX_WINDOW_BIT)) {
|
||||||
|
|
Loading…
Reference in New Issue