summaryrefslogtreecommitdiff
path: root/glx/glxcmdsswap.c
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2011-01-26 13:06:53 +0100
committerJulien Cristau <jcristau@debian.org>2011-02-15 12:19:59 +0100
commit1137c11be0f82049d28024eaf963c6f76e0d4334 (patch)
tree11739d9550cc818c20ac384084588893a30cde1c /glx/glxcmdsswap.c
parenta883cf1545abd89bb2cadfa659718884b56fd234 (diff)
glx: fix BindTexImageEXT length check
The request is followed by a list of attributes. X.Org bug#33449 Reported-and-tested-by: meng <mengmeng.meng@intel.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx/glxcmdsswap.c')
-rw-r--r--glx/glxcmdsswap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c
index 9d96c9de3..d58de6299 100644
--- a/glx/glxcmdsswap.c
+++ b/glx/glxcmdsswap.c
@@ -648,19 +648,23 @@ int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
GLXDrawable *drawId;
int *buffer;
+ CARD32 *num_attribs;
__GLX_DECLARE_SWAP_VARIABLES;
- REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8);
+ if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len)
+ return BadLength;
pc += __GLX_VENDPRIV_HDR_SIZE;
drawId = ((GLXDrawable *) (pc));
buffer = ((int *) (pc + 4));
+ num_attribs = ((CARD32 *) (pc + 8));
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
__GLX_SWAP_INT(drawId);
__GLX_SWAP_INT(buffer);
+ __GLX_SWAP_INT(num_attribs);
return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc);
}