summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2006-02-17 21:18:09 +0000
committerAndrei Zmievski <andrei@php.net>2006-02-17 21:18:09 +0000
commitf10bab6f97a5c4e2e05891866822d0ef1b53f139 (patch)
treee2b054954c84eb10c711d9009361e9821a12eff5 /ext/pcre/php_pcre.c
parenta8be85ce7eecc3d36cb0249671d16d2cbd9ee8eb (diff)
downloadphp-git-f10bab6f97a5c4e2e05891866822d0ef1b53f139.tar.gz
MFH.
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 1ed0df8035..557898abf3 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1462,7 +1462,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++) {
@@ -1494,6 +1494,8 @@ PHP_FUNCTION(preg_quote)
case '\0':
*q++ = '\\';
*q++ = '0';
+ *q++ = '0';
+ *q++ = '0';
break;
default: