From c3b7e90652e9d932933ca70c737be4c78994c1b3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 22 May 2009 09:54:38 +0200 Subject: [PATCH] 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 triggered when all allocated space wasn't used. X.Org bug#21861 Reported-by: Guillaume Quintin Signed-off-by: Julien Cristau --- randr/rrscreen.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 36ef86e..5b76e57 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -664,8 +664,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) { -- 1.6.3.1