summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-05-07 17:21:19 -0400
committerAdam Jackson <ajax@redhat.com>2018-05-08 12:15:30 -0400
commit9f21872ad8591c1f6f8ea1e466f212c3582d3c33 (patch)
treefab5e04f5f4aa47eade594ac0f829f96ad1e08d4 /glx
parentb9f415cbad47412bfb218cf7375d0c2856a27d1b (diff)
glx: Be sure to set an error for ghost contexts
Otherwise the caller is going to return garbage memory for the error value. Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 6785e9db3..54d452e58 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -137,8 +137,10 @@ validGlxContext(ClientPtr client, XID id, int access_mode,
__GLXcontext ** context, int *err)
{
/* no ghost contexts */
- if (id & SERVER_BIT)
+ if (id & SERVER_BIT) {
+ *err = __glXError(GLXBadContext);
return FALSE;
+ }
*err = dixLookupResourceByType((void **) context, id,
__glXContextRes, client, access_mode);