From f0d1cca6729f2593900af10d6aa324b7eedfe0c3 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 29 May 2016 20:15:16 +0100 Subject: Use empty keys instead of _empty_ in json decoding --- ext/json/json_parser.tab.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ext/json/json_parser.tab.c') 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); -- cgit v1.2.1 From 323b2733f6b42d00dd86e77ac524d64f6ddc4e22 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 22 Jun 2016 00:40:50 +0300 Subject: Fixed compilation warnings --- ext/json/json_parser.tab.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/json/json_parser.tab.c') diff --git a/ext/json/json_parser.tab.c b/ext/json/json_parser.tab.c index 862912c4ec..b4f426e07a 100644 --- a/ext/json/json_parser.tab.c +++ b/ext/json/json_parser.tab.c @@ -139,8 +139,8 @@ int json_yydebug = 1; /* In a future release of Bison, this section will be replaced by #include "json_parser.tab.h". */ -#ifndef YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED -# define YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED +#ifndef YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED +# define YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -201,7 +201,7 @@ typedef union YYSTYPE YYSTYPE; int php_json_yyparse (php_json_parser *parser); -#endif /* !YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */ +#endif /* !YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ -- cgit v1.2.1