You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/11/10 15:46:41 UTC

[5/6] guacamole-server git commit: GUACAMOLE-630: Define maximum "argv" stream length for SSH and telnet with symbolic constants.

GUACAMOLE-630: Define maximum "argv" stream length for SSH and telnet with symbolic constants.


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

Branch: refs/heads/master
Commit: 0cf24219d83dd9b9b68e7456400f58087f3815d8
Parents: f293c5e
Author: Michael Jumper <mj...@apache.org>
Authored: Fri Nov 9 20:27:28 2018 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Fri Nov 9 20:27:28 2018 -0800

----------------------------------------------------------------------
 src/protocols/ssh/argv.c    | 2 +-
 src/protocols/ssh/argv.h    | 6 ++++++
 src/protocols/telnet/argv.c | 2 +-
 src/protocols/telnet/argv.h | 6 ++++++
 4 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/0cf24219/src/protocols/ssh/argv.c
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/argv.c b/src/protocols/ssh/argv.c
index 85dca94..00a2cbb 100644
--- a/src/protocols/ssh/argv.c
+++ b/src/protocols/ssh/argv.c
@@ -38,7 +38,7 @@ typedef struct guac_ssh_argv {
     /**
      * Buffer space for containing the received argument value.
      */
-    char buffer[16384];
+    char buffer[GUAC_SSH_ARGV_MAX_LENGTH];
 
     /**
      * The number of bytes received so far.

http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/0cf24219/src/protocols/ssh/argv.h
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/argv.h b/src/protocols/ssh/argv.h
index 27b08cb..88cf8e9 100644
--- a/src/protocols/ssh/argv.h
+++ b/src/protocols/ssh/argv.h
@@ -26,6 +26,12 @@
 #include <guacamole/user.h>
 
 /**
+ * The maximum number of bytes to allow for any argument value received via an
+ * argv stream, including null terminator.
+ */
+#define GUAC_SSH_ARGV_MAX_LENGTH 16384
+
+/**
  * Handles an incoming stream from a Guacamole "argv" instruction, updating the
  * given connection parameter if that parameter is allowed to be updated.
  */

http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/0cf24219/src/protocols/telnet/argv.c
----------------------------------------------------------------------
diff --git a/src/protocols/telnet/argv.c b/src/protocols/telnet/argv.c
index da405aa..0735928 100644
--- a/src/protocols/telnet/argv.c
+++ b/src/protocols/telnet/argv.c
@@ -38,7 +38,7 @@ typedef struct guac_telnet_argv {
     /**
      * Buffer space for containing the received argument value.
      */
-    char buffer[16384];
+    char buffer[GUAC_TELNET_ARGV_MAX_LENGTH];
 
     /**
      * The number of bytes received so far.

http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/0cf24219/src/protocols/telnet/argv.h
----------------------------------------------------------------------
diff --git a/src/protocols/telnet/argv.h b/src/protocols/telnet/argv.h
index b1567ea..aa13dda 100644
--- a/src/protocols/telnet/argv.h
+++ b/src/protocols/telnet/argv.h
@@ -26,6 +26,12 @@
 #include <guacamole/user.h>
 
 /**
+ * The maximum number of bytes to allow for any argument value received via an
+ * argv stream, including null terminator.
+ */
+#define GUAC_TELNET_ARGV_MAX_LENGTH 16384
+
+/**
  * Handles an incoming stream from a Guacamole "argv" instruction, updating the
  * given connection parameter if that parameter is allowed to be updated.
  */