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 615799 - json-glib aborts when parsing UTF-16 surrogate pairs
json-glib aborts when parsing UTF-16 surrogate pairs
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: 2010-04-15 00:36 UTC by Eiichi Sato
Modified: 2012-03-13 22:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for parsing surrogate pairs in json string. (1.93 KB, patch)
2010-04-15 00:36 UTC, Eiichi Sato
committed Details | Review

Description Eiichi Sato 2010-04-15 00:36:50 UTC
Created attachment 158769 [details] [review]
Patch for parsing surrogate pairs in json string.

Overview: 
  json_parser_load_from_*() aborts when json string contains UTF16 surrogate pairs. (ex. "\ud842\udf9f")


Step to Reproduce: 
  The following piece should reproduce the bug.
  --- 
  gchar * json = "{\"text\": \"\\u3092\\ud842\\udf9f\\u308b\"}";
  JsonParser * parser = json_parser_new();
  json_parser_load_from_data(parser, json, -1, NULL);
  ---


Actual Results:
  Aborted printing "Json:ERROR:./json-scanner.c:895:json_scanner_get_unichar: assertion failed: (g_unichar_validate (uchar))"


Build Date & Platform: 
  Build 2010-04-15 on Ubuntu 9.04


Additional Information: 
  I attached small patch. Hope this helps.
Comment 1 Emmanuele Bassi (:ebassi) 2010-04-15 08:27:05 UTC
Review of attachment 158769 [details] [review]:

the patch looks fine, thanks!
Comment 2 Emmanuele Bassi (:ebassi) 2010-04-15 08:29:01 UTC
Pushed to json-glib master, will backport to the stable branch as well.
Comment 3 André Klapper 2012-03-13 22:08:34 UTC
[Fixing Default QA assignee for json-glib - see 613232#c1. Sorry for bugmail noise.]