https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212176

--- Comment #6 from Ivan <b...@abinet.ru> ---
Created attachment 174716
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=174716&action=edit
patch

Problem is here
g_strlcpy (text, p, g_utf8_strlen (text, -1));

To utf-8 unaware function number of chars are passed instead of bytes, so it's
possible for 2 bytes chars it will split in half leading to incorrect unicode
sequence.

Attached patch resolves the issue, however crash still can occur if p >= text,
however as p is substring of text, the situation is expected to never happen in
normal conditions.

I found no safe analog in gtk functions for strlcpy, only strncpy which is not
considered safe. The alternative is switch to icu, however this is another
story.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-xfce@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-xfce
To unsubscribe, send any mail to "freebsd-xfce-unsubscr...@freebsd.org"

Reply via email to