[PATCH xserver 3/4] glx: Be sure to set an error for ghost contexts

Adam Jackson ajax at redhat.com
Mon May 7 21:21:19 UTC 2018


Otherwise the caller is going to return garbage memory for the error
value.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxcmds.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 6785e9db38..54d452e587 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);
-- 
2.17.0



More information about the xorg-devel mailing list