]> granicus.if.org Git - php/commitdiff
Don't leak json error_code across requests
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 10:41:52 +0000 (12:41 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 10:42:09 +0000 (12:42 +0200)
ext/json/json.c

index cbf4f84014cf85b5da15d6d92acd68ce43110795..df46294cd672ba7abbcc2c7f30e52140f80cc468 100644 (file)
@@ -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,