https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286439
Dag-Erling Smørgrav <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #13 from Dag-Erling Smørgrav <[email protected]> --- Created attachment 260665 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=260665&action=edit proper fix for UTF-8 bug The reason the patch currently causes py-libxml to crash is that it was mismerged when libxml was upgraded to 2.11.6. The “ensure the error string doesn't start at UTF8 continuation” bit was supposed to happen after the `vsnprintf()` call. For unexplained reasons, it was moved to _before_ that call where, as others have pointed out, it operates on uninitialized data. However, this patch was never the correct fix. The bug occurs when `str` is too small for the message and the message is truncated in the middle of a UTF-8 sequence, so you need to trim the _end_ of `str`, but what the patch does is skip any partial UTF-8 sequences that occur at the _beginning_ of `str`, which I'm not sure is even possible unless the format string or some of the arguments passed to the handler are malformed. If you don't want to reintroduce the original bug, I suggest you use the attached patch instead of just dropping patch-python_libxml.c. -- You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug.
