From 9768618ad07883a29c0eb47868bf74725d1cebf7 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 6 Aug 2024 15:59:38 +0200 Subject: [PATCH] (!1639) Xext: vidmode: fix length checking with bigreq The authorative source of the request frame size is client->req_len, especially with big requests larger than 2^18 bytes. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/vidmode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Xext/vidmode.c b/Xext/vidmode.c index c7c61647e..0490bf29a 100644 --- a/Xext/vidmode.c +++ b/Xext/vidmode.c @@ -471,7 +471,7 @@ ProcVidModeAddModeLine(ClientPtr client) if (ver < 2) { /* convert from old format */ stuff = &newstuff; - stuff->length = oldstuff->length; + stuff->length = client->req_len; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay; @@ -641,7 +641,7 @@ ProcVidModeDeleteModeLine(ClientPtr client) if (ver < 2) { /* convert from old format */ stuff = &newstuff; - stuff->length = oldstuff->length; + stuff->length = client->req_len; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay; @@ -670,7 +670,7 @@ ProcVidModeDeleteModeLine(ClientPtr client) "len = %d, length = %d\n", (unsigned long) client->req_len, (int) sizeof(xXF86VidModeDeleteModeLineReq) >> 2, - (unsigned long) stuff->privsize, len, stuff->length); + (unsigned long) stuff->privsize, len, client->req_len); return BadLength; } @@ -765,7 +765,7 @@ ProcVidModeModModeLine(ClientPtr client) if (ver < 2) { /* convert from old format */ stuff = &newstuff; - stuff->length = oldstuff->length; + stuff->length = client->req_len; stuff->screen = oldstuff->screen; stuff->hdisplay = oldstuff->hdisplay; stuff->hsyncstart = oldstuff->hsyncstart; @@ -899,7 +899,7 @@ ProcVidModeValidateModeLine(ClientPtr client) if (ver < 2) { /* convert from old format */ stuff = &newstuff; - stuff->length = oldstuff->length; + stuff->length = client->req_len; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay; @@ -1052,7 +1052,7 @@ ProcVidModeSwitchToMode(ClientPtr client) if (ver < 2) { /* convert from old format */ stuff = &newstuff; - stuff->length = oldstuff->length; + stuff->length = client->req_len; stuff->screen = oldstuff->screen; stuff->dotclock = oldstuff->dotclock; stuff->hdisplay = oldstuff->hdisplay;