aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorAnastasia Belova <abelova@astralinux.ru>2023-06-09 12:23:06 +0300
committerMichael Tokarev <mjt@tls.msk.ru>2023-06-11 11:03:26 +0300
commit9b55660e4a4f6bfea0965b2567641492a1feac57 (patch)
treee286f6cd3d973c4ed62cacb22ada002484953fdd /ui
parent8eb73afedc143f5ca4798d055a4cc7de39194c6c (diff)
vnc: move assert in vnc_worker_thread_loop
job may be NULL if queue->exit is true. Check it before dereference job. Fixes: f31f9c1080 ("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 bdfca8a22f41e7ad47fd2dac71e4d1387e2c0d4e) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'ui')
-rw-r--r--ui/vnc-jobs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index 886f9bf611..fcca7ec632 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -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);