aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2009-05-22 09:54:38 +0200
committerUlrich Sibiller <uli42@gmx.de>2015-06-07 00:08:55 +0200
commitfaddfbec6ff331c3859e2f57040da4a8cf072baa (patch)
treecaaaf9221f7fea6d8d3e824de91f920e2e443f10
parentda678db0ef57c45f1bbe1c0e8f14da70746ed2cd (diff)
downloadnx-libs-faddfbec6ff331c3859e2f57040da4a8cf072baa.tar.gz
nx-libs-faddfbec6ff331c3859e2f57040da4a8cf072baa.tar.bz2
nx-libs-faddfbec6ff331c3859e2f57040da4a8cf072baa.zip
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 <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--nx-X11/programs/Xserver/randr/rrscreen.c5
1 files changed, 3 insertions, 2 deletions
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)
{