Commit 18517a55 authored by Leif Middelschulte's avatar Leif Middelschulte Committed by Peter Hutterer

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: default avatarLeif Middelschulte <leif.middelschulte@gmail.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 7a7bac90
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment