Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-server/pull/154#discussion_r171998112
--- Diff: src/protocols/rdp/guac_rdpdr/rdpdr_printer.c ---
@@ -141,18 +142,23 @@ static void
guac_rdpdr_device_printer_announce_handler(guac_rdpdr_device* device
Stream_Write(output_stream, "PRN1\0\0\0\0", 8); /* DOS name */
/* Printer data */
- Stream_Write_UINT32(output_stream, 24 + GUAC_PRINTER_DRIVER_LENGTH +
GUAC_PRINTER_NAME_LENGTH);
+ int settings_length = strlen(device->device_name);
--- End diff --
Unfortunately, this value will not be what you expect if the device name
contains any multi-byte characters. You will instead end up with the number of
bytes in the string, not the number of characters. You can use
`guac_utf8_strlen()`, however, which is part of libguac:
https://github.com/apache/guacamole-server/blob/bc5b01d4d8ab0c3c89a08007316d33012261f6b3/src/libguac/guacamole/unicode.h#L41-L48
---