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

This commit is contained in:
Michael Jumper 2018-11-09 20:27:28 -08:00
parent f293c5e9c0
commit 0cf24219d8
4 changed files with 14 additions and 2 deletions

View File

@ -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.

View File

@ -25,6 +25,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.

View File

@ -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.

View File

@ -25,6 +25,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.