summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-09-23 17:22:39 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-04-01 10:58:42 +0200
commit7329ad767f5413459cc98210eea754a5de95af1e (patch)
treedf90223d774ee846db4e9877bc5def0c358f4dd8 /src
parent4835df0b642dfc963e7cbaabfe93da86482f0b93 (diff)
downloadvd_agent-7329ad767f5413459cc98210eea754a5de95af1e.tar.gz
vd_agent-7329ad767f5413459cc98210eea754a5de95af1e.tar.xz
vd_agent-7329ad767f5413459cc98210eea754a5de95af1e.zip
Handle get_current_mon_config() failures
get_current_mon_config() can return NULL, but vdagent_x11_set_monitor_config() was calling it without checking if it's NULL before dereferencing it. This issue was pinpointed by Coverity.
Diffstat (limited to 'src')
-rw-r--r--src/vdagent-x11-randr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vdagent-x11-randr.c b/src/vdagent-x11-randr.c
index 46367bc..f48f045 100644
--- a/src/vdagent-x11-randr.c
+++ b/src/vdagent-x11-randr.c
@@ -735,6 +735,8 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
}
curr = get_current_mon_config(x11);
+ if (!curr)
+ goto exit;
if (same_monitor_configs(mon_config, curr) &&
x11->width[0] == primary_w && x11->height[0] == primary_h) {
goto exit;