summaryrefslogtreecommitdiff
path: root/ext/json/JSON_parser.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-05-29 12:53:32 +0200
committerNikita Popov <nikic@php.net>2014-05-29 12:53:32 +0200
commitbfff679d903c7ef1648d3d009f42566baa7d6232 (patch)
treee66e317484cb739be2d816cd179feb485db2b012 /ext/json/JSON_parser.c
parentccd9dab4c6f2d2df313b40705cf00a395fa4b080 (diff)
downloadphp-git-bfff679d903c7ef1648d3d009f42566baa7d6232.tar.gz
Fix length reset in JSON parser
Diffstat (limited to 'ext/json/JSON_parser.c')
-rw-r--r--ext/json/JSON_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c
index c7fc6b4f2f..116fc0c9b6 100644
--- a/ext/json/JSON_parser.c
+++ b/ext/json/JSON_parser.c
@@ -712,7 +712,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
jp->error_code = PHP_JSON_ERROR_SYNTAX;
return false;
}
- buf.s->len = 0;
+ if (buf.s) { buf.s->len = 0; }
JSON_RESET_TYPE();
}
break;