]> granicus.if.org Git - php/commitdiff
Don't leak pcre error_code across requests
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 09:01:59 +0000 (11:01 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 22 Oct 2020 09:20:02 +0000 (11:20 +0200)
ext/pcre/php_pcre.c

index ee340829ee6111f7f1ab99842b137a03513df735..4a796062ec79ff1c968bf699a85f355f8fd89781 100644 (file)
@@ -486,6 +486,7 @@ static PHP_RINIT_FUNCTION(pcre)
        mdata_used = 0;
 #endif
 
+       PCRE_G(error_code) = PHP_PCRE_NO_ERROR;
        PCRE_G(gctx_zmm) = pcre2_general_context_create(php_pcre_emalloc, php_pcre_efree, NULL);
        if (!PCRE_G(gctx_zmm)) {
                return FAILURE;