From 15f6c4f3dc51c68e0f869fb13c75c79bd2f0a4db Mon Sep 17 00:00:00 2001 From: itsankoff Date: Tue, 24 Oct 2017 20:21:03 +0300 Subject: [PATCH] GUACAMOLE-424: Fix null pointer dereference for vnc client display --- src/protocols/vnc/user.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/protocols/vnc/user.c b/src/protocols/vnc/user.c index 7e123732..b036785f 100644 --- a/src/protocols/vnc/user.c +++ b/src/protocols/vnc/user.c @@ -112,8 +112,10 @@ int guac_vnc_user_leave_handler(guac_user* user) { guac_vnc_client* vnc_client = (guac_vnc_client*) user->client->data; - /* Update shared cursor state */ - guac_common_cursor_remove_user(vnc_client->display->cursor, user); + if (vnc_client && vnc_client->display && vnc_client->display->cursor) { + /* Update shared cursor state */ + guac_common_cursor_remove_user(vnc_client->display->cursor, user); + } /* Free settings if not owner (owner settings will be freed with client) */ if (!user->owner) {