]> granicus.if.org Git - php/commitdiff
Fix Bug #53963, error code isn't always set in certain error cases.
authorScott MacVicar <scottmac@php.net>
Wed, 9 Feb 2011 08:05:00 +0000 (08:05 +0000)
committerScott MacVicar <scottmac@php.net>
Wed, 9 Feb 2011 08:05:00 +0000 (08:05 +0000)
NEWS
ext/json/JSON_parser.c

diff --git a/NEWS b/NEWS
index 4f7331246fdd1806dbd9ab7c1393c3558b12963f..4ef711fadc8e0ced8059ff4d4f15bc2386cbab21 100644 (file)
--- a/NEWS
+++ b/NEWS
   . 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)
index 259b77b084519e439c5a9bc8a4ae0a0f68b5f23d..ec07a4803d3e9b03d52e4f0174353756a179208a 100644 (file)
@@ -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;