From: Andrei Zmievski Date: Fri, 17 Feb 2006 21:18:51 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.4.3RC1~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56fcffbec57d78f614b02698604a21ef34b28306;p=php MFH --- diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index f3e405d774..8b42ef251d 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1406,7 +1406,7 @@ PHP_FUNCTION(preg_quote) /* Allocate enough memory so that even if each character is quoted, we won't run out of room */ - out_str = safe_emalloc(2, Z_STRLEN_PP(in_str_arg), 1); + out_str = safe_emalloc(4, Z_STRLEN_PP(in_str_arg), 1); /* Go through the string and quote necessary characters */ for(p = in_str, q = out_str; p != in_str_end; p++) { @@ -1438,6 +1438,8 @@ PHP_FUNCTION(preg_quote) case '\0': *q++ = '\\'; *q++ = '0'; + *q++ = '0'; + *q++ = '0'; break; default: