summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUri Lublin <uril@redhat.com>2012-12-17 18:34:43 +0200
committerUri Lublin <uril@redhat.com>2013-01-01 12:37:11 +0200
commit1ff42341629948c591621f0a8ddf2859543ca05d (patch)
tree4f1a3b36a000bacbaa1c72bea03c7893240c695f
parent55ebd0a1c02e4323b1a8a39d59ea2c066ea45fa2 (diff)
server: guest_set_client_capabilities: protect against NULL worker->display_channel
Reported-by: Michal Luscon <mluscon@redhat.com> Found by a Coverity scan: in handle_dev_start - Checking "worker->display_channel" implies that "worker->display_channel" might be NULL. Passing "worker" to function "guest_set_client_capabilities" in guest_set_client_capabilities - Directly dereferencing parameter "worker->display_channel"
-rw-r--r--server/red_worker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index e5e3d05..1a9c375 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10342,7 +10342,8 @@ static void guest_set_client_capabilities(RedWorker *worker)
worker->set_client_capabilities_pending = 1;
return;
}
- if (worker->display_channel->common.base.clients_num == 0) {
+ if ((worker->display_channel == NULL) ||
+ (worker->display_channel->common.base.clients_num == 0)) {
worker->qxl->st->qif->set_client_capabilities(worker->qxl, FALSE, caps);
} else {
// Take least common denominator