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
{
char *p = string, *pe = string, *unescape;
int unescape_len;
char buf[4];
while (pe < stringEnd) {
if (*pe == '\\') {
......
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)) {
ext/json/parser/parser.rl
{
char *p = string, *pe = string, *unescape;
int unescape_len;
char buf[4];
while (pe < stringEnd) {
if (*pe == '\\') {
......
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)) {
(4-4/4)