summaryrefslogtreecommitdiff
path: root/ext/json/json_parser.tab.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/json_parser.tab.c')
-rw-r--r--ext/json/json_parser.tab.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/json/json_parser.tab.c b/ext/json/json_parser.tab.c
index 02002d681b..862912c4ec 100644
--- a/ext/json/json_parser.tab.c
+++ b/ext/json/json_parser.tab.c
@@ -1881,10 +1881,7 @@ static int php_json_parser_object_update(php_json_parser *parser, zval *object,
zend_symtable_update(Z_ARRVAL_P(object), key, zvalue);
} else {
zval zkey;
- if (ZSTR_LEN(key) == 0) {
- zend_string_release(key);
- key = zend_string_init("_empty_", sizeof("_empty_") - 1, 0);
- } else if (ZSTR_VAL(key)[0] == '\0') {
+ if (ZSTR_LEN(key) > 0 && ZSTR_VAL(key)[0] == '\0') {
parser->scanner.errcode = PHP_JSON_ERROR_INVALID_PROPERTY_NAME;
zend_string_release(key);
zval_dtor(zvalue);