<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40299 >
2008/6/22 Jason Dorje Short:
> Also with utf-8 truncating things like this is not at all safe. This
> can send incorrect utf-8 to the server which when sent back to the
> client becomes very hard to handle. GTK will crash (yes, crash) if
> given invalid utf-8; it's supposed to be checked before it's passed in
> but I'm not sure if we do that. If it is checked the best thing the
> client could do is discard the invalid utf-8 string.
Actually, that truncation is not needed with any correctly working
implementation of vsnprintf(). Ending zero should be there already,
and hopefully in right place UTF-8 wise.
But does it makes sense to send such truncated command at all. At
worst case we execute wrong variant of the command that has different
versions taking different number of parameters. At best case we are
just abbreviating something so that server still understands it.
Freeciv-dev mailing list