summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-10-22 12:41:52 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-10-22 12:42:09 +0200
commitaa0d886cbc8ab4a227568c2bc5f2f00b7e378cfc (patch)
tree83eabca7038541d132b7a1b4bcc66d477a4690eb /ext/json
parent41b8cdd2e0ec4478166c577e6a4d6a9223094f71 (diff)
downloadphp-git-aa0d886cbc8ab4a227568c2bc5f2f00b7e378cfc.tar.gz
Don't leak json error_code across requests
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/json.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/json/json.c b/ext/json/json.c
index cbf4f84014..df46294cd6 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -104,6 +104,11 @@ static PHP_GINIT_FUNCTION(json)
}
/* }}} */
+static PHP_RINIT_FUNCTION(json)
+{
+ JSON_G(error_code) = 0;
+ return SUCCESS;
+}
/* {{{ json_module_entry */
zend_module_entry json_module_entry = {
@@ -112,7 +117,7 @@ zend_module_entry json_module_entry = {
ext_functions,
PHP_MINIT(json),
NULL,
- NULL,
+ PHP_RINIT(json),
NULL,
PHP_MINFO(json),
PHP_JSON_VERSION,