escra commented on PR #659: URL: https://github.com/apache/guacamole-server/pull/659#issuecomment-4443747608
Good catch. You're right, `available` alone doesn't account for the encoding expansion when converting to UTF-16. Worst case with CRLF normalization enabled is 4x (a single `\n` becomes `\r\n` in UTF-16 = 4 output bytes for 1 input byte). Without CRLF it's 2x as you noted. `guac_iconv()` won't overflow the buffer, it just stops writing, so this causes truncation rather than corruption. The original fixed-size buffer had the same limitation. I'll update to use `available * 4` which covers all format + CRLF combinations. -- 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]
