moriyoshi               Tue Jan 21 14:31:08 2003 EDT

  Modified files:              
    /php4/ext/mbstring  php_mbregex.c 
  Log:
  Fixed mb_ereg_search() segfault that occurs when the function is called
  before a string to be searched is passed by mb_ereg_search_init() 
  
  
Index: php4/ext/mbstring/php_mbregex.c
diff -u php4/ext/mbstring/php_mbregex.c:1.27 php4/ext/mbstring/php_mbregex.c:1.28
--- php4/ext/mbstring/php_mbregex.c:1.27        Sat Jan 18 15:09:29 2003
+++ php4/ext/mbstring/php_mbregex.c     Tue Jan 21 14:31:07 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_mbregex.c,v 1.27 2003/01/18 20:09:29 iliaa Exp $ */
+/* $Id: php_mbregex.c,v 1.28 2003/01/21 19:31:07 moriyoshi Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -855,7 +855,7 @@
        pos = MBSTRG(search_pos);
        str = NULL;
        len = 0;
-       if (Z_TYPE_PP(MBSTRG(search_str)) == IS_STRING){
+       if (MBSTRG(search_str) != NULL && Z_TYPE_PP(MBSTRG(search_str)) == IS_STRING){
                str = (unsigned char *)Z_STRVAL_PP(MBSTRG(search_str));
                len = Z_STRLEN_PP(MBSTRG(search_str));
        }



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

Reply via email to