guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [1/2] incubator-guacamole-server git commit: GUACAMOLE-306: Do not attempt to send VNC events with a non-existent VNC client object.
Date Sun, 21 May 2017 18:20:44 GMT
Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master 04205a9b9 -> 6d2cfdabf


GUACAMOLE-306: Do not attempt to send VNC events with a non-existent VNC client object.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/8024f134
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/8024f134
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/8024f134

Branch: refs/heads/master
Commit: 8024f134587949c97c8bc6f7941a2aaac9af76fc
Parents: 0e5498f
Author: Michael Jumper <mjumper@apache.org>
Authored: Fri May 19 14:05:03 2017 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Fri May 19 14:20:28 2017 -0700

----------------------------------------------------------------------
 src/protocols/vnc/clipboard.c |  5 +++--
 src/protocols/vnc/input.c     | 10 ++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/8024f134/src/protocols/vnc/clipboard.c
----------------------------------------------------------------------
diff --git a/src/protocols/vnc/clipboard.c b/src/protocols/vnc/clipboard.c
index 8a80223..a49f565 100644
--- a/src/protocols/vnc/clipboard.c
+++ b/src/protocols/vnc/clipboard.c
@@ -113,8 +113,9 @@ int guac_vnc_clipboard_end_handler(guac_user* user, guac_stream* stream)
{
     guac_iconv(GUAC_READ_UTF8, &input, vnc_client->clipboard->length,
                writer, &output, sizeof(output_data));
 
-    /* Send via VNC */
-    SendClientCutText(rfb_client, output_data, output - output_data);
+    /* Send via VNC only if finished connecting */
+    if (rfb_client != NULL)
+        SendClientCutText(rfb_client, output_data, output - output_data);
 
     return 0;
 }

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/8024f134/src/protocols/vnc/input.c
----------------------------------------------------------------------
diff --git a/src/protocols/vnc/input.c b/src/protocols/vnc/input.c
index d8fcda5..86f4ca7 100644
--- a/src/protocols/vnc/input.c
+++ b/src/protocols/vnc/input.c
@@ -30,11 +30,14 @@ int guac_vnc_user_mouse_handler(guac_user* user, int x, int y, int mask)
{
 
     guac_client* client = user->client;
     guac_vnc_client* vnc_client = (guac_vnc_client*) client->data;
+    rfbClient* rfb_client = vnc_client->rfb_client;
 
     /* Store current mouse location */
     guac_common_cursor_move(vnc_client->display->cursor, user, x, y);
 
-    SendPointerEvent(vnc_client->rfb_client, x, y, mask);
+    /* Send VNC event only if finished connecting */
+    if (rfb_client != NULL)
+        SendPointerEvent(rfb_client, x, y, mask);
 
     return 0;
 }
@@ -42,8 +45,11 @@ int guac_vnc_user_mouse_handler(guac_user* user, int x, int y, int mask)
{
 int guac_vnc_user_key_handler(guac_user* user, int keysym, int pressed) {
 
     guac_vnc_client* vnc_client = (guac_vnc_client*) user->client->data;
+    rfbClient* rfb_client = vnc_client->rfb_client;
 
-    SendKeyEvent(vnc_client->rfb_client, keysym, pressed);
+    /* Send VNC event only if finished connecting */
+    if (rfb_client != NULL)
+        SendKeyEvent(rfb_client, keysym, pressed);
 
     return 0;
 }


Mime
View raw message