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 789444 - Fix handling of length in g_utf8_make_valid
Fix handling of length in g_utf8_make_valid
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.54.x
Other All
: Normal critical
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-10-24 22:30 UTC by Ole André Vadla Ravnås
Modified: 2017-10-25 09:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gutf8: Fix length handling in g_utf8_make_valid() (1.58 KB, patch)
2017-10-24 22:33 UTC, Ole André Vadla Ravnås
committed Details | Review

Description Ole André Vadla Ravnås 2017-10-24 22:30:20 UTC
We cannot blindly append the remainder in case the string isn't nul-
terminated.
Comment 1 Ole André Vadla Ravnås 2017-10-24 22:33:24 UTC
Created attachment 362225 [details] [review]
gutf8: Fix length handling in g_utf8_make_valid()

We cannot blindly append the remainder when a length was provided
because the string isn't nul-terminated.
Comment 2 Philip Withnall 2017-10-25 09:33:30 UTC
Review of attachment 362225 [details] [review]:

Good catch. Thanks for the test case too.
Comment 3 Philip Withnall 2017-10-25 09:34:10 UTC
Attachment 362225 [details] pushed as b829b76 - gutf8: Fix length handling in g_utf8_make_valid()