jmuehlner commented on code in PR #395:
URL: https://github.com/apache/guacamole-server/pull/395#discussion_r993867430
##########
src/terminal/terminal.c:
##########
@@ -2165,11 +2166,21 @@ void guac_terminal_clipboard_reset(guac_terminal*
terminal,
void guac_terminal_clipboard_append(guac_terminal* terminal,
const char* data, int length) {
- guac_common_clipboard_append(terminal->clipboard, data, length);
+
+ /* Allocate and clear space for the converted data */
+ char output_data[GUAC_COMMON_CLIPBOARD_MAX_LENGTH];
+ memset(output_data, '\0', GUAC_COMMON_CLIPBOARD_MAX_LENGTH);
Review Comment:
From the documentation of `guac_iconv()`
> The input and output string pointers will be updated based on the number
of bytes read or written.
Looks like you could just check how many characters the string pointer has
been incremented to get your answer.
Also probably want to make sure that you handle the case where
`guac_iconv()` returns `0`. (You wouldn't want to call `strlen()` in that case).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]