andrei          Fri Feb 17 21:17:44 2006 UTC

  Modified files:              
    /php-src/ext/pcre   php_pcre.c 
  Log:
  NULL byte should be escaped to \000 instead of \0 in case it is followed
  by an octal digit. (found by Jeffrey Friedl)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/php_pcre.c?r1=1.176&r2=1.177&diff_format=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.176 php-src/ext/pcre/php_pcre.c:1.177
--- php-src/ext/pcre/php_pcre.c:1.176   Sun Jan  1 13:09:52 2006
+++ php-src/ext/pcre/php_pcre.c Fri Feb 17 21:17:44 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_pcre.c,v 1.176 2006/01/01 13:09:52 sniper Exp $ */
+/* $Id: php_pcre.c,v 1.177 2006/02/17 21:17:44 andrei Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1466,7 +1466,7 @@
        
        /* 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++) {
@@ -1498,6 +1498,8 @@
                        case '\0':
                                *q++ = '\\';
                                *q++ = '0';
+                               *q++ = '0';
+                               *q++ = '0';
                                break;
 
                        default:

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to