You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2017/11/15 15:06:38 UTC

[1/7] incubator-guacamole-server git commit: GUACAMOLE-424: Fix null pointer dereference for vnc client display

Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master a75bca1e9 -> 2c12c1285


GUACAMOLE-424: Fix null pointer dereference for vnc client display


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/15f6c4f3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/15f6c4f3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/15f6c4f3

Branch: refs/heads/master
Commit: 15f6c4f3dc51c68e0f869fb13c75c79bd2f0a4db
Parents: 95be88b
Author: itsankoff <iv...@gmail.com>
Authored: Tue Oct 24 20:21:03 2017 +0300
Committer: itsankoff <iv...@gmail.com>
Committed: Tue Oct 24 20:21:03 2017 +0300

----------------------------------------------------------------------
 src/protocols/vnc/user.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/15f6c4f3/src/protocols/vnc/user.c
----------------------------------------------------------------------
diff --git a/src/protocols/vnc/user.c b/src/protocols/vnc/user.c
index 7e12373..b036785 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) {


[2/7] incubator-guacamole-server git commit: GUACAMOLE-424: Prevent null pointer dereference for vnc client display and cursor

Posted by mj...@apache.org.
GUACAMOLE-424: Prevent null pointer dereference for vnc client display and cursor


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/bbafa00d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/bbafa00d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/bbafa00d

Branch: refs/heads/master
Commit: bbafa00df0df242ac308462e16e78c4c23e88a96
Parents: 15f6c4f
Author: itsankoff <iv...@gmail.com>
Authored: Thu Nov 2 19:53:17 2017 +0200
Committer: itsankoff <iv...@gmail.com>
Committed: Thu Nov 2 19:53:17 2017 +0200

----------------------------------------------------------------------
 src/protocols/vnc/user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/bbafa00d/src/protocols/vnc/user.c
----------------------------------------------------------------------
diff --git a/src/protocols/vnc/user.c b/src/protocols/vnc/user.c
index b036785..ea09eb0 100644
--- a/src/protocols/vnc/user.c
+++ b/src/protocols/vnc/user.c
@@ -112,7 +112,7 @@ int guac_vnc_user_leave_handler(guac_user* user) {
 
     guac_vnc_client* vnc_client = (guac_vnc_client*) user->client->data;
 
-    if (vnc_client && vnc_client->display && vnc_client->display->cursor) {
+    if (vnc_client->display && vnc_client->display->cursor) {
         /* Update shared cursor state */
         guac_common_cursor_remove_user(vnc_client->display->cursor, user);
     }


[6/7] incubator-guacamole-server git commit: GUACAMOLE-424: Update doc comments

Posted by mj...@apache.org.
GUACAMOLE-424: Update doc comments


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/aa6d81d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/aa6d81d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/aa6d81d6

Branch: refs/heads/master
Commit: aa6d81d6f944df6654c74ab4b514b1fa388c4850
Parents: e139b20
Author: itsankoff <iv...@gmail.com>
Authored: Wed Nov 15 14:58:06 2017 +0200
Committer: itsankoff <iv...@gmail.com>
Committed: Wed Nov 15 15:02:08 2017 +0200

----------------------------------------------------------------------
 src/common/cursor.c  | 4 +++-
 src/common/display.c | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/aa6d81d6/src/common/cursor.c
----------------------------------------------------------------------
diff --git a/src/common/cursor.c b/src/common/cursor.c
index 616f23b..f621b94 100644
--- a/src/common/cursor.c
+++ b/src/common/cursor.c
@@ -37,10 +37,12 @@
 
 /**
  * Allocates a cursor as well as an image buffer where the cursor is rendered.
- * If the allocation fails then the function returns NULL.
  *
  * @param client
  *     The client owning the cursor.
+ *
+ * @return
+ *     The newly-allocated cursor or NULL if cursor cannot be allocated.
  */
 guac_common_cursor* guac_common_cursor_alloc(guac_client* client) {
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/aa6d81d6/src/common/display.c
----------------------------------------------------------------------
diff --git a/src/common/display.c b/src/common/display.c
index ff70c58..5d8ce9f 100644
--- a/src/common/display.c
+++ b/src/common/display.c
@@ -101,7 +101,7 @@ static void guac_common_display_free_layers(guac_common_display_layer* layers,
 
 /**
  * Allocates a display and a cursor which are used to represent the remote
- * display and cursor. If the allocation fails then the function returns NULL.
+ * display and cursor.
  *
  * @param client
  *     The client owning the cursor.
@@ -111,6 +111,9 @@ static void guac_common_display_free_layers(guac_common_display_layer* layers,
  *
  * @param height
  *     The desired height of the display.
+ *
+ * @return
+ *     The newly-allocated display or NULL if display cannot be allocated.
  */
 guac_common_display* guac_common_display_alloc(guac_client* client,
         int width, int height) {


[5/7] incubator-guacamole-server git commit: GUACAMOLE-424: Remove check against NULL for display cursor

Posted by mj...@apache.org.
GUACAMOLE-424: Remove check against NULL for display cursor


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/e139b20d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/e139b20d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/e139b20d

Branch: refs/heads/master
Commit: e139b20d12f7dccf06b08494e1154735b2f12510
Parents: f7990af
Author: itsankoff <iv...@gmail.com>
Authored: Mon Nov 13 14:51:31 2017 +0200
Committer: itsankoff <iv...@gmail.com>
Committed: Mon Nov 13 14:51:31 2017 +0200

----------------------------------------------------------------------
 src/protocols/vnc/user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/e139b20d/src/protocols/vnc/user.c
----------------------------------------------------------------------
diff --git a/src/protocols/vnc/user.c b/src/protocols/vnc/user.c
index ea09eb0..da3b843 100644
--- a/src/protocols/vnc/user.c
+++ b/src/protocols/vnc/user.c
@@ -112,7 +112,7 @@ int guac_vnc_user_leave_handler(guac_user* user) {
 
     guac_vnc_client* vnc_client = (guac_vnc_client*) user->client->data;
 
-    if (vnc_client->display && vnc_client->display->cursor) {
+    if (vnc_client->display) {
         /* Update shared cursor state */
         guac_common_cursor_remove_user(vnc_client->display->cursor, user);
     }


[4/7] incubator-guacamole-server git commit: GUACAMOLE-424: Return NULL if guac_common_display allocation fails

Posted by mj...@apache.org.
GUACAMOLE-424: Return NULL if guac_common_display allocation fails


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/f7990af6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/f7990af6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/f7990af6

Branch: refs/heads/master
Commit: f7990af6d0c6aac58b705049e52c2587c21b6596
Parents: da0fc1a
Author: itsankoff <iv...@gmail.com>
Authored: Mon Nov 13 14:50:44 2017 +0200
Committer: itsankoff <iv...@gmail.com>
Committed: Mon Nov 13 14:50:44 2017 +0200

----------------------------------------------------------------------
 src/common/display.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/f7990af6/src/common/display.c
----------------------------------------------------------------------
diff --git a/src/common/display.c b/src/common/display.c
index 09bf67e..ff70c58 100644
--- a/src/common/display.c
+++ b/src/common/display.c
@@ -99,6 +99,19 @@ static void guac_common_display_free_layers(guac_common_display_layer* layers,
 
 }
 
+/**
+ * Allocates a display and a cursor which are used to represent the remote
+ * display and cursor. If the allocation fails then the function returns NULL.
+ *
+ * @param client
+ *     The client owning the cursor.
+ *
+ * @param width
+ *     The desired width of the display.
+ *
+ * @param height
+ *     The desired height of the display.
+ */
 guac_common_display* guac_common_display_alloc(guac_client* client,
         int width, int height) {
 
@@ -107,14 +120,18 @@ guac_common_display* guac_common_display_alloc(guac_client* client,
     if (display == NULL)
         return NULL;
 
+    /* Allocate shared cursor */
+    display->cursor = guac_common_cursor_alloc(client);
+    if (display->cursor == NULL) {
+        free(display);
+        return NULL;
+    }
+
     pthread_mutex_init(&display->_lock, NULL);
 
     /* Associate display with given client */
     display->client = client;
 
-    /* Allocate shared cursor */
-    display->cursor = guac_common_cursor_alloc(client);
-
     display->default_surface = guac_common_surface_alloc(client,
             client->socket, GUAC_DEFAULT_LAYER, width, height);
 


[7/7] incubator-guacamole-server git commit: GUACAMOLE-424: Merge changes addressing potential NULL-pointer dereference in VNC user leave handler.

Posted by mj...@apache.org.
GUACAMOLE-424: Merge changes addressing potential NULL-pointer dereference in VNC user leave handler.


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/2c12c128
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/2c12c128
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/2c12c128

Branch: refs/heads/master
Commit: 2c12c12850f12cd586c32809b374fee8d4b9bd53
Parents: a75bca1 aa6d81d
Author: Michael Jumper <mj...@apache.org>
Authored: Wed Nov 15 07:05:21 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Wed Nov 15 07:05:21 2017 -0800

----------------------------------------------------------------------
 src/common/cursor.c      | 10 ++++++++++
 src/common/display.c     | 26 +++++++++++++++++++++++---
 src/protocols/vnc/user.c |  6 ++++--
 3 files changed, 37 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[3/7] incubator-guacamole-server git commit: GUACAMOLE-424: Add doc comment for guac_common_cursor_alloc

Posted by mj...@apache.org.
GUACAMOLE-424: Add doc comment for guac_common_cursor_alloc


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/da0fc1a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/da0fc1a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/da0fc1a6

Branch: refs/heads/master
Commit: da0fc1a6d8c2296eec2c43ca06cb9f37df18d9f7
Parents: bbafa00
Author: itsankoff <iv...@gmail.com>
Authored: Mon Nov 13 14:49:44 2017 +0200
Committer: itsankoff <iv...@gmail.com>
Committed: Mon Nov 13 14:49:44 2017 +0200

----------------------------------------------------------------------
 src/common/cursor.c | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/da0fc1a6/src/common/cursor.c
----------------------------------------------------------------------
diff --git a/src/common/cursor.c b/src/common/cursor.c
index f956f6a..616f23b 100644
--- a/src/common/cursor.c
+++ b/src/common/cursor.c
@@ -34,6 +34,14 @@
 #include <stdlib.h>
 #include <string.h>
 
+
+/**
+ * Allocates a cursor as well as an image buffer where the cursor is rendered.
+ * If the allocation fails then the function returns NULL.
+ *
+ * @param client
+ *     The client owning the cursor.
+ */
 guac_common_cursor* guac_common_cursor_alloc(guac_client* client) {
 
     guac_common_cursor* cursor = malloc(sizeof(guac_common_cursor));