diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-11-25 08:04:05 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-11-26 08:32:11 +0100 |
commit | 7fe4a41c262e2529dc79f77f6fe63c5309fa2fd9 (patch) | |
tree | f04edc0daf27fb601883b993c18d9b2beb13974d /ui | |
parent | 4b6eda626fdb8bf90472c6868d502a2ac09abeeb (diff) |
vnc: fix segfault
Commit "c7628bf vnc: only alloc server surface with clients connected"
missed one rarely used codepath (cirrus with guest drivers using 2d
accel) where we have to check for the server surface being present,
to avoid qemu crashing with a NULL pointer dereference. Add the check.
Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Tested-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/vnc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -931,6 +931,11 @@ static void vnc_dpy_copy(DisplayChangeListener *dcl, int i, x, y, pitch, inc, w_lim, s; int cmp_bytes; + if (!vd->server) { + /* no client connected */ + return; + } + vnc_refresh_server_surface(vd); QTAILQ_FOREACH_SAFE(vs, &vd->clients, next, vn) { if (vnc_has_feature(vs, VNC_FEATURE_COPYRECT)) { |