From faddfbec6ff331c3859e2f57040da4a8cf072baa Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 22 May 2009 09:54:38 +0200 Subject: Backport: 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 Reported-by: Guillaume Quintin Signed-off-by: Julien Cristau --- nx-X11/programs/Xserver/randr/rrscreen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs') diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c index 9bea97b9f..20eed1196 100644 --- a/nx-X11/programs/Xserver/randr/rrscreen.c +++ b/nx-X11/programs/Xserver/randr/rrscreen.c @@ -677,8 +677,9 @@ ProcRRGetScreenInfo (ClientPtr client) rep.sizeID = pData->size; rep.rate = pData->refresh; - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); + extraLen = rep.nSizes * sizeof (xScreenSizes); + if (has_rate) + extraLen += rep.nrateEnts * sizeof (CARD16); if (extraLen) { -- cgit v1.2.3