Skip to content

Commit 1ff4234

Browse files
committed
server: guest_set_client_capabilities: protect against NULL worker->display_channel
Reported-by: Michal Luscon <[email protected]> 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"
1 parent 55ebd0a commit 1ff4234

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/red_worker.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -10342,7 +10342,8 @@ static void guest_set_client_capabilities(RedWorker *worker)
1034210342
worker->set_client_capabilities_pending = 1;
1034310343
return;
1034410344
}
10345-
if (worker->display_channel->common.base.clients_num == 0) {
10345+
if ((worker->display_channel == NULL) ||
10346+
(worker->display_channel->common.base.clients_num == 0)) {
1034610347
worker->qxl->st->qif->set_client_capabilities(worker->qxl, FALSE, caps);
1034710348
} else {
1034810349
// Take least common denominator

0 commit comments

Comments
 (0)