Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
vnc: move assert in vnc_worker_thread_loop
job may be NULL if queue->exit is true. Check
it before dereference job.

Fixes: f31f9c1 ("vnc: add magic cookie to VncState")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit bdfca8a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
Anastasia Belova authored and Michael Tokarev committed Jun 11, 2023
1 parent 967e429 commit d09e35f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/vnc-jobs.c
Expand Up @@ -250,12 +250,13 @@ static int vnc_worker_thread_loop(VncJobQueue *queue)
/* Here job can only be NULL if queue->exit is true */
job = QTAILQ_FIRST(&queue->jobs);
vnc_unlock_queue(queue);
assert(job->vs->magic == VNC_MAGIC);

if (queue->exit) {
return -1;
}

assert(job->vs->magic == VNC_MAGIC);

vnc_lock_output(job->vs);
if (job->vs->ioc == NULL || job->vs->abort == true) {
vnc_unlock_output(job->vs);
Expand Down

0 comments on commit d09e35f

Please sign in to comment.