mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
vnc_refresh: return if vd->timer is NULL
Hi all, calling vnc_update_client in vnc_refresh might have the unlikely side effect of setting vd->timer = NULL, if the last vnc client disconnected. In this case we have to return from vnc_refresh without updating the timer, otherwise we cause a segfault. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
dbd483242c
commit
83755c173f
1 changed files with 4 additions and 0 deletions
4
vnc.c
4
vnc.c
|
@ -2305,6 +2305,10 @@ static void vnc_refresh(void *opaque)
|
|||
rects += vnc_update_client(vs, has_dirty);
|
||||
vs = vs->next;
|
||||
}
|
||||
/* vd->timer could be NULL now if the last client disconnected,
|
||||
* in this case don't update the timer */
|
||||
if (vd->timer == NULL)
|
||||
return;
|
||||
|
||||
if (has_dirty && rects) {
|
||||
vd->timer_interval /= 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue