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 727755 - parser should use length parameter when validating utf-8
parser should use length parameter when validating utf-8
Status: RESOLVED FIXED
Product: json-glib
Classification: Core
Component: Parser
git master
Other Linux
: Normal normal
: ---
Assigned To: json-glib-maint
json-glib-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-07 14:34 UTC by Dirk-Jan C. Binnema
Modified: 2014-04-24 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
json-parser: use length parameter when validating utf-8 (816 bytes, patch)
2014-04-07 14:40 UTC, Dirk-Jan C. Binnema
committed Details | Review

Description Dirk-Jan C. Binnema 2014-04-07 14:34:10 UTC
I got some "JSON data must be UTF-8 encoded" when parsing some data (from a GByteArray), because the utf-8 validation assumes the data is \0-terminated, which isn't necessarily true.
Comment 1 Dirk-Jan C. Binnema 2014-04-07 14:40:21 UTC
Created attachment 273717 [details] [review]
json-parser: use length parameter when validating utf-8
Comment 2 Emmanuele Bassi (:ebassi) 2014-04-17 14:34:58 UTC
looks good; I thought I alredy did this, but it turned out that passing the length uncovered a bug in JsonParser's input stream handling which I didn't have time to investigate fully and fix. I've done that, now, and pushed the patch on top.

Attachment 273717 [details] pushed as 13397eb - json-parser: use length parameter when validating utf-8
Comment 3 Dirk-Jan C. Binnema 2014-04-24 11:46:11 UTC
Thanks for the quick response / fix!