summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStéphane Marchesin <marcheu@chromium.org>2012-05-24 17:58:53 -0700
committerStéphane Marchesin <marcheu@chromium.org>2012-06-12 14:42:22 -0700
commit0256edd709d976198d5354fdd88143d8da9e51d5 (patch)
treee5dfe87a83679cca9cb4943c6aae227379c35203 /src
parent1657dec72d6dcb6158bb65cea2e1b6ff2445746c (diff)
glx: Handle a null reply in QueryVersion.
Works around crashes when X connections break. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> NOTE: This is a candidate for the 8.0 branch.
Diffstat (limited to 'src')
-rw-r--r--src/glx/glxext.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 12fff22399d..a4e76c1c398 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -293,6 +293,9 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
GLX_MINOR_VERSION),
NULL);
+ if (!reply)
+ return GL_FALSE;
+
if (reply->major_version != GLX_MAJOR_VERSION) {
free(reply);
return GL_FALSE;