Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-server/pull/156#discussion_r175279035
--- Diff: src/terminal/terminal.c ---
@@ -1594,7 +1598,13 @@ static int __guac_terminal_send_key(guac_terminal*
term, int keysym, int pressed
/* Non-printable keys */
else {
- if (keysym == 0xFF08) return guac_terminal_send_string(term,
"\x7F"); /* Backspace */
+ /* Backspace can vary based on configuration of terminal by
client. */
+ if (keysym == 0xFF08) {
+ char* backspace_str = malloc(sizeof(char) * 2);
+ backspace_str[0] = term->backspace;
+ backspace_str[1] = '\0';
+ return guac_terminal_send_string(term, backspace_str);
--- End diff --
Returning here without freeing the memory allocated above will leak memory
each time backspace is pressed. Probably shouldn't be dynamically allocating at
all, though (see above).
---