From b2c6bc488b22025213fc39b73139e5c640ffeaa1 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 17 Jul 2014 12:33:46 -0700 Subject: [PATCH] GUAC-763: Remove stripping of non-printable chars. It will break UTF-8, and the signedness of line_buffer makes the comparisons questionable. --- src/protocols/telnet/telnet_client.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/protocols/telnet/telnet_client.c b/src/protocols/telnet/telnet_client.c index 6794d750..35893379 100644 --- a/src/protocols/telnet/telnet_client.c +++ b/src/protocols/telnet/telnet_client.c @@ -122,13 +122,6 @@ static bool __guac_telnet_regex_search(guac_client* client, regex_t* regex, char length += size; line_buffer[length] = '\0'; - /* Remove non-printable characters as they interfere with regex matching */ - for (int i = 0; i < length; i++) { - if (line_buffer[i] <= 31 || (line_buffer[i] >= 128 && line_buffer[i] <= 255)) { - line_buffer[i] = ' '; - } - } - /* Send password upon match */ if (regexec(regex, line_buffer, 0, NULL, 0) == 0) {