summaryrefslogtreecommitdiff
path: root/ext/json/json.c
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2015-06-21 15:30:33 +0100
committerJakub Zelenka <bukka@php.net>2015-06-21 15:30:33 +0100
commitf3df3df8737ace9f4431416fdd0d312cb0ee9cfd (patch)
tree4d1031a3f6156ea1a83c94e39018118077f87d59 /ext/json/json.c
parent115e9288bbd28f7ad525ebcc0053908464be5c95 (diff)
downloadphp-git-f3df3df8737ace9f4431416fdd0d312cb0ee9cfd.tar.gz
Fix bug #68546 (json_decode cannot access property started with \0)
Diffstat (limited to 'ext/json/json.c')
-rw-r--r--ext/json/json.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/json/json.c b/ext/json/json.c
index 1caef65013..8088a89b4e 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -121,6 +121,7 @@ static PHP_MINIT_FUNCTION(json)
REGISTER_LONG_CONSTANT("JSON_ERROR_RECURSION", PHP_JSON_ERROR_RECURSION, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("JSON_ERROR_INF_OR_NAN", PHP_JSON_ERROR_INF_OR_NAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("JSON_ERROR_UNSUPPORTED_TYPE", PHP_JSON_ERROR_UNSUPPORTED_TYPE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("JSON_ERROR_INVALID_PROPERTY_NAME", PHP_JSON_ERROR_INVALID_PROPERTY_NAME, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("JSON_OBJECT_AS_ARRAY", PHP_JSON_OBJECT_AS_ARRAY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("JSON_BIGINT_AS_STRING", PHP_JSON_BIGINT_AS_STRING, CONST_CS | CONST_PERSISTENT);
@@ -300,6 +301,8 @@ static PHP_FUNCTION(json_last_error_msg)
RETURN_STRING("Inf and NaN cannot be JSON encoded");
case PHP_JSON_ERROR_UNSUPPORTED_TYPE:
RETURN_STRING("Type is not supported");
+ case PHP_JSON_ERROR_INVALID_PROPERTY_NAME:
+ RETURN_STRING("The decoded property name is invalid");
default:
RETURN_STRING("Unknown error");
}