GUACAMOLE-630: Disallow NULL color schemes.
A color scheme string should always be provided, even if blank. Disallowing NULL allows assumptions to be made which simplifies the logic surrounding persisting provided configuration values.
This commit is contained in:
parent
b5191caddc
commit
0516d599cf
@ -197,7 +197,7 @@ void guac_terminal_parse_color_scheme(guac_client* client,
|
|||||||
guac_terminal_color (*palette)[256]) {
|
guac_terminal_color (*palette)[256]) {
|
||||||
|
|
||||||
/* Special cases. */
|
/* Special cases. */
|
||||||
if (color_scheme == NULL || color_scheme[0] == '\0') {
|
if (color_scheme[0] == '\0') {
|
||||||
/* guac_terminal_parse_color_scheme defaults to gray-black */
|
/* guac_terminal_parse_color_scheme defaults to gray-black */
|
||||||
}
|
}
|
||||||
else if (strcmp(color_scheme, GUAC_TERMINAL_SCHEME_GRAY_BLACK) == 0) {
|
else if (strcmp(color_scheme, GUAC_TERMINAL_SCHEME_GRAY_BLACK) == 0) {
|
||||||
|
@ -561,8 +561,8 @@ struct guac_terminal {
|
|||||||
*
|
*
|
||||||
* @param color_scheme
|
* @param color_scheme
|
||||||
* The name of the color scheme to use. This string must be one of the
|
* The name of the color scheme to use. This string must be one of the
|
||||||
* names defined by the GUAC_TERMINAL_SCHEME_* constants. If blank or NULL,
|
* names defined by the GUAC_TERMINAL_SCHEME_* constants. If blank, the
|
||||||
* the default scheme of GUAC_TERMINAL_SCHEME_GRAY_BLACK will be used. If
|
* default scheme of GUAC_TERMINAL_SCHEME_GRAY_BLACK will be used. If
|
||||||
* invalid, a warning will be logged, and the terminal will fall back on
|
* invalid, a warning will be logged, and the terminal will fall back on
|
||||||
* GUAC_TERMINAL_SCHEME_GRAY_BLACK.
|
* GUAC_TERMINAL_SCHEME_GRAY_BLACK.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user