ODROID-U3 xorg-server debian package fork :
[deb_xorg-server.git] / debian / patches / CVE-2014-8xxx / 0034-CVE-2014-8097-additional.patch
CommitLineData
7217e0ca
ML
1From b20912c3d45cbbde3c443e6c3d9e189092fe65e1 Mon Sep 17 00:00:00 2001
2From: Keith Packard <keithp@keithp.com>
3Date: Tue, 9 Dec 2014 09:30:57 -0800
4Subject: dbe: Call to DDX SwapBuffers requires address of int, not unsigned
5 int [CVE-2014-8097 pt. 2]
6
7When the local types used to walk the DBE request were changed, this
8changed the type of the parameter passed to the DDX SwapBuffers API,
9but there wasn't a matching change in the API definition.
10
11At this point, with the API frozen, I just stuck a new variable in
12with the correct type. Because we've already bounds-checked nStuff to
13be smaller than UINT32_MAX / sizeof(DbeSwapInfoRec), we know it will
14fit in a signed int without overflow.
15
16Signed-off-by: Keith Packard <keithp@keithp.com
17Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
18Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
19
7217e0ca
ML
20--- a/dbe/dbe.c
21+++ b/dbe/dbe.c
22@@ -452,6 +452,7 @@ ProcDbeSwapBuffers(ClientPtr client)
23 int error;
24 unsigned int i, j;
25 unsigned int nStuff;
26+ int nStuff_i; /* DDX API requires int for nStuff */
27
28 REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
29 nStuff = stuff->n; /* use local variable for performance. */
30@@ -527,9 +528,10 @@ ProcDbeSwapBuffers(ClientPtr client)
31 * could deal with cross-screen synchronization.
32 */
33
34- while (nStuff > 0) {
35+ nStuff_i = nStuff;
36+ while (nStuff_i > 0) {
37 pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(swapInfo[0].pWindow);
38- error = (*pDbeScreenPriv->SwapBuffers) (client, &nStuff, swapInfo);
39+ error = (*pDbeScreenPriv->SwapBuffers) (client, &nStuff_i, swapInfo);
40 if (error != Success) {
41 free(swapInfo);
42 return error;