From: Scott MacVicar Date: Wed, 9 Feb 2011 08:05:00 +0000 (+0000) Subject: Fix Bug #53963, error code isn't always set in certain error cases. X-Git-Tag: php-5.3.6RC1~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b567fea6a68225ef0ba651956e91e97edf8d92e;p=php Fix Bug #53963, error code isn't always set in certain error cases. --- diff --git a/NEWS b/NEWS index 4f7331246f..4ef711fadc 100644 --- a/NEWS +++ b/NEWS @@ -75,6 +75,10 @@ . Implemented clone functionality for number, date & message formatters. (Stas). +- JSON extension: + . Fixed bug #53963 (Ensure error_code is always set during some failed + decodings). (Scott) + - MySQL Improved extension: . Added 'db' and 'catalog' keys to the field fetching functions (FR #39847). (Kalle) diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c index 259b77b084..ec07a4803d 100644 --- a/ext/json/JSON_parser.c +++ b/ext/json/JSON_parser.c @@ -656,6 +656,7 @@ parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int /* fall through if not IS_STRING */ default: FREE_BUFFERS(); + jp->error_code = PHP_JSON_ERROR_SYNTAX; return false; } break; @@ -695,6 +696,7 @@ parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int break; default: FREE_BUFFERS(); + jp->error_code = PHP_JSON_ERROR_SYNTAX; return false; } buf.len = 0;