From 58e26eb312f8a6c2c0d2fa99943f91bdd8f32a83 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 27 Apr 2017 10:12:03 -0700 Subject: [PATCH] GUACAMOLE-278: argc value received by 256-color SGR sequence parser must equal the number of remaining argv elements. --- src/terminal/terminal_handlers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminal/terminal_handlers.c b/src/terminal/terminal_handlers.c index afc64b92..55fd6824 100644 --- a/src/terminal/terminal_handlers.c +++ b/src/terminal/terminal_handlers.c @@ -928,7 +928,7 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) { /* Attempt to set foreground with 256-color entry */ 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); /* 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 */ 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); /* Reset background */