ext/json/ext/parser/parser.rl in json_pure-1.6.4 vs ext/json/ext/parser/parser.rl in json_pure-1.6.5

- old
+ new

@@ -403,10 +403,11 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd) { char *p = string, *pe = string, *unescape; int unescape_len; + char buf[4]; while (pe < stringEnd) { if (*pe == '\\') { unescape = (char *) "?"; unescape_len = 1; @@ -435,10 +436,9 @@ break; case 'u': if (pe > stringEnd - 4) { return Qnil; } else { - char buf[4]; UTF32 ch = unescape_unicode((unsigned char *) ++pe); pe += 3; if (UNI_SUR_HIGH_START == (ch & 0xFC00)) { pe++; if (pe > stringEnd - 6) return Qnil;