summaryrefslogtreecommitdiff
path: root/glx/glxcmds.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2012-11-09 18:05:27 -0500
committerAdam Jackson <ajax@redhat.com>2013-09-11 14:37:32 -0400
commitb99f7975407f111b99d772cd28224d7dc1b34fe4 (patch)
tree9d49b6892af767471398d7d1ecb7dc9d0a49b632 /glx/glxcmds.c
parent22fbfdcb31f335c22053a0e29f0e73c03cd70a76 (diff)
glx: Handle failure to create the pixmap backing the pbuffer
We happen not to sanitize the width/height we pass to CreatePixmap here, oops. It's not exploitable, but it's certainly a crash, so let's just throw BadAlloc instead. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx/glxcmds.c')
-rw-r--r--glx/glxcmds.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 27a68aa37..9426fc154 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1416,6 +1416,8 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
width, height,
config->rgbBits, 0);
__glXleaveServer(GL_FALSE);
+ if (!pPixmap)
+ return BadAlloc;
/* Assign the pixmap the same id as the pbuffer and add it as a
* resource so it and the DRI2 drawable will be reclaimed when the