]> 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)
ext/json/JSON_parser.c

index ef05f3b43c767fc404520d775f344973f38fd9da..dd832a7cbd7e7ab8dfdcb64ce9db1795d51fdecf 100644 (file)
@@ -673,6 +673,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
                                        /* fall through if not IS_STRING */
                 default:
                     FREE_BUFFERS();
+                    jp->error_code = PHP_JSON_ERROR_SYNTAX;
                     return false;
                 }
                 break;
@@ -712,6 +713,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
                         break;
                     default:
                         FREE_BUFFERS();
+                        jp->error_code = PHP_JSON_ERROR_SYNTAX;
                         return false;
                 }
                 buf.len = 0;