Project

General

Profile

Backport #5888 ยป ruby-1.9.3-fix-json-parser.patch

Anonymous, 01/16/2012 04:30 PM

View differences:

ext/json/parser/parser.c
1293 1293
{
1294 1294
    char *p = string, *pe = string, *unescape;
1295 1295
    int unescape_len;
1296
    char buf[4];
1296 1297

  
1297 1298
    while (pe < stringEnd) {
1298 1299
        if (*pe == '\\') {
......
1325 1326
                    if (pe > stringEnd - 4) {
1326 1327
                        return Qnil;
1327 1328
                    } else {
1328
                        char buf[4];
1329 1329
                        UTF32 ch = unescape_unicode((unsigned char *) ++pe);
1330 1330
                        pe += 3;
1331 1331
                        if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {
ext/json/parser/parser.rl
393 393
{
394 394
    char *p = string, *pe = string, *unescape;
395 395
    int unescape_len;
396
    char buf[4];
396 397

  
397 398
    while (pe < stringEnd) {
398 399
        if (*pe == '\\') {
......
425 426
                    if (pe > stringEnd - 4) {
426 427
                        return Qnil;
427 428
                    } else {
428
                        char buf[4];
429 429
                        UTF32 ch = unescape_unicode((unsigned char *) ++pe);
430 430
                        pe += 3;
431 431
                        if (UNI_SUR_HIGH_START == (ch & 0xFC00)) {