Skip to content

Commit aa0d886

Browse files
committed
Don't leak json error_code across requests
1 parent 41b8cdd commit aa0d886

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎ext/json/json.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ static PHP_GINIT_FUNCTION(json)
104104
}
105105
/* }}} */
106106

107+
static PHP_RINIT_FUNCTION(json)
108+
{
109+
JSON_G(error_code) = 0;
110+
return SUCCESS;
111+
}
107112

108113
/* {{{ json_module_entry */
109114
zend_module_entry json_module_entry = {
@@ -112,7 +117,7 @@ zend_module_entry json_module_entry = {
112117
ext_functions,
113118
PHP_MINIT(json),
114119
NULL,
115-
NULL,
120+
PHP_RINIT(json),
116121
NULL,
117122
PHP_MINFO(json),
118123
PHP_JSON_VERSION,

0 commit comments

Comments
 (0)