summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2009-05-22 09:54:38 +0200
committerJulien Cristau <jcristau@debian.org>2009-05-24 11:13:47 +0200
commit12e725d08b4cf7dbb7f09b9ec09fa1b621156ea9 (patch)
tree358d47f0c6fb1b86a914721cd4c0d3740ecd37ea
parentc70511931ca1441878daed50e710fa514f6ab077 (diff)
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>
-rw-r--r--randr/rrscreen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 94bf3ce99..46890bf74 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -664,8 +664,9 @@ ProcRRGetScreenInfo (ClientPtr client)
664 rep.sizeID = pData->size; 664 rep.sizeID = pData->size;
665 rep.rate = pData->refresh; 665 rep.rate = pData->refresh;
666 666
667 extraLen = (rep.nSizes * sizeof (xScreenSizes) + 667 extraLen = rep.nSizes * sizeof (xScreenSizes);
668 rep.nrateEnts * sizeof (CARD16)); 668 if (has_rate)
669 extraLen += rep.nrateEnts * sizeof (CARD16);
669 670
670 if (extraLen) 671 if (extraLen)
671 { 672 {