diff --git a/src/protocols/ssh/argv.c b/src/protocols/ssh/argv.c index 85dca943..00a2cbba 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. diff --git a/src/protocols/ssh/argv.h b/src/protocols/ssh/argv.h index 27b08cbf..88cf8e97 100644 --- a/src/protocols/ssh/argv.h +++ b/src/protocols/ssh/argv.h @@ -25,6 +25,12 @@ #include +/** + * 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. diff --git a/src/protocols/telnet/argv.c b/src/protocols/telnet/argv.c index da405aa9..07359286 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. diff --git a/src/protocols/telnet/argv.h b/src/protocols/telnet/argv.h index b1567ea8..aa13dda9 100644 --- a/src/protocols/telnet/argv.h +++ b/src/protocols/telnet/argv.h @@ -25,6 +25,12 @@ #include +/** + * 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.