randr: fix server crash in RRGetScreenInfo

We don't return rates to randr < 1.1 clients, so don't allocate space
for them.  This fixes a FatalError due to not all allocated space being
used.

X.Org bug#21861 <http://bugs.freedesktop.org/show_bug.cgi?id=21861>

Reported-by: Guillaume Quintin <coincoin169g@gmail.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
Julien Cristau 2009-05-22 09:54:38 +02:00
parent c70511931c
commit 12e725d08b

View File

@ -664,8 +664,9 @@ ProcRRGetScreenInfo (ClientPtr client)
rep.sizeID = pData->size; rep.sizeID = pData->size;
rep.rate = pData->refresh; rep.rate = pData->refresh;
extraLen = (rep.nSizes * sizeof (xScreenSizes) + extraLen = rep.nSizes * sizeof (xScreenSizes);
rep.nrateEnts * sizeof (CARD16)); if (has_rate)
extraLen += rep.nrateEnts * sizeof (CARD16);
if (extraLen) if (extraLen)
{ {