summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeif Middelschulte <leif.middelschulte@gmail.com>2010-05-25 14:52:50 -0300
committerPeter Hutterer <peter.hutterer@who-t.net>2010-05-26 16:41:28 -0400
commit18517a55d08cdcf9e29bed6761cf4311e1d4109f (patch)
tree1bf0bc760b95a331df314e881a352afd385c0245 /src
parent7a7bac907ac15033c0ddb979202c7f3ddc368726 (diff)
Add parameter safety check
As mentioned in bugzilla ticket 28150. Calling '_XRRValidateCache' with 'improper' arguments results in a SEGV. This patch adds a parameter validation to the mentioned function. Signed-off-by: Leif Middelschulte <leif.middelschulte@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/XrrConfig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/XrrConfig.c b/src/XrrConfig.c
index 34ff3ef..793d8b6 100644
--- a/src/XrrConfig.c
+++ b/src/XrrConfig.c
@@ -105,7 +105,7 @@ static XRRScreenConfiguration *_XRRValidateCache (Display *dpy,
XRRScreenConfiguration **configs;
XRandRInfo *xrri;
- if (XextHasExtension(info)) {
+ if ((screen >= 0) && (screen < ScreenCount(dpy)) && XextHasExtension(info)) {
xrri = (XRandRInfo *) info->data;
configs = xrri->config;