json-parser.c (574bf16ff1f836a442d8de1853eb248c218a591d) json-parser.c (4b1c0cd7c7f9f9cf2e46c0a9c9cd88b2cba3decd)
1/*
2 * JSON Parser
3 *
4 * Copyright IBM, Corp. 2009
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 186 unchanged lines hidden (view full) ---

195 qstring_append(str, utf8_char);
196 } break;
197 default:
198 parse_error(ctxt, token, "invalid escape sequence in string");
199 goto out;
200 }
201 } else {
202 cp = mod_utf8_codepoint(ptr, 6, &end);
1/*
2 * JSON Parser
3 *
4 * Copyright IBM, Corp. 2009
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 186 unchanged lines hidden (view full) ---

195 qstring_append(str, utf8_char);
196 } break;
197 default:
198 parse_error(ctxt, token, "invalid escape sequence in string");
199 goto out;
200 }
201 } else {
202 cp = mod_utf8_codepoint(ptr, 6, &end);
203 if (cp <= 0) {
203 if (cp < 0) {
204 parse_error(ctxt, token, "invalid UTF-8 sequence in string");
205 goto out;
206 }
207 ptr = end;
208 len = mod_utf8_encode(utf8_buf, sizeof(utf8_buf), cp);
209 assert(len >= 0);
210 qstring_append(str, utf8_buf);
211 }

--- 380 unchanged lines hidden ---
204 parse_error(ctxt, token, "invalid UTF-8 sequence in string");
205 goto out;
206 }
207 ptr = end;
208 len = mod_utf8_encode(utf8_buf, sizeof(utf8_buf), cp);
209 assert(len >= 0);
210 qstring_append(str, utf8_buf);
211 }

--- 380 unchanged lines hidden ---