GNOME Bugzilla – Bug 615799
json-glib aborts when parsing UTF-16 surrogate pairs
Last modified: 2012-03-13 22:08:34 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.
Review of attachment 158769 [details] [review]: the patch looks fine, thanks!
Pushed to json-glib master, will backport to the stable branch as well.
[Fixing Default QA assignee for json-glib - see 613232#c1. Sorry for bugmail noise.]