After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700577 - Support invalid UTF-8 chars in pango_find_paragraph_boundary()
Support invalid UTF-8 chars in pango_find_paragraph_boundary()
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.34.x
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 637270
 
 
Reported: 2013-05-18 14:27 UTC by Sébastien Wilmet
Modified: 2013-05-28 06:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Support invalid UTF-8 chars in pango_find_paragraph_boundary() (1.00 KB, patch)
2013-05-18 14:29 UTC, Sébastien Wilmet
none Details | Review

Description Sébastien Wilmet 2013-05-18 14:27:40 UTC
When trying to fix bug #637270, I came across a problem in pango_find_paragraph_boundary() when the text contains invalid UTF-8 chars.
Comment 1 Sébastien Wilmet 2013-05-18 14:29:43 UTC
Created attachment 244618 [details] [review]
Support invalid UTF-8 chars in pango_find_paragraph_boundary()

At the end of the while loop, g_utf8_next_char() is called. If p points
to an invalid UTF-8 char, the next char can be skipped. And if the next
char is the end of the string, we have p > end.

Tested with the string "foobar\xC0".
Comment 2 Behdad Esfahbod 2013-05-27 21:27:14 UTC
Fixed.  Thanks.
Comment 3 Paolo Borelli 2013-05-28 06:01:12 UTC
Sébastien: what about also adding a unit test? :-)