GUACAMOLE-278: argc value received by 256-color SGR sequence parser must equal the number of remaining argv elements.

This commit is contained in:
Michael Jumper 2017-04-27 10:12:03 -07:00
parent 0e5498fc83
commit 58e26eb312

View File

@ -928,7 +928,7 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) {
/* Attempt to set foreground with 256-color entry */ /* Attempt to set foreground with 256-color entry */
int xterm256_length = int xterm256_length =
guac_terminal_parse_xterm256(argc - 1, &argv[i + 1], guac_terminal_parse_xterm256(argc - i - 1, &argv[i + 1],
&term->current_attributes.foreground); &term->current_attributes.foreground);
/* If valid 256-color entry, foreground has been set */ /* If valid 256-color entry, foreground has been set */
@ -959,7 +959,7 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) {
/* 256-color background */ /* 256-color background */
else if (value == 48) else if (value == 48)
i += guac_terminal_parse_xterm256(argc - 1, &argv[i + 1], i += guac_terminal_parse_xterm256(argc - i - 1, &argv[i + 1],
&term->current_attributes.background); &term->current_attributes.background);
/* Reset background */ /* Reset background */