moriyoshi Wed Apr 2 19:15:13 2003 EDT
Modified files:
/php4/ext/mbstring php_mbregex.c
Log:
Fixed segfault in mb_ereg_match()
Index: php4/ext/mbstring/php_mbregex.c
diff -u php4/ext/mbstring/php_mbregex.c:1.37 php4/ext/mbstring/php_mbregex.c:1.38
--- php4/ext/mbstring/php_mbregex.c:1.37 Wed Apr 2 19:01:44 2003
+++ php4/ext/mbstring/php_mbregex.c Wed Apr 2 19:15:13 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mbregex.c,v 1.37 2003/04/03 00:01:44 moriyoshi Exp $ */
+/* $Id: php_mbregex.c,v 1.38 2003/04/03 00:15:13 moriyoshi Exp $ */
#ifdef HAVE_CONFIG_H
@@ -782,7 +782,8 @@
Regular expression match for multibyte string */
PHP_FUNCTION(mb_ereg_match)
{
- zval *arg_pattern;
+ char *arg_pattern;
+ int arg_pattern_len;
char *string;
int string_len;
@@ -795,8 +796,8 @@
char *option_str = NULL;
int option_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s",
- &arg_pattern, &string, &string_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s",
+ &arg_pattern, &arg_pattern_len, &string,
&string_len,
&option_str, &option_str_len)==FAILURE) {
RETURN_FALSE;
}
@@ -807,12 +808,11 @@
option |= MBSTRG(regex_default_options);
}
}
- convert_to_string_ex(&arg_pattern);
err = php_mbregex_compile_pattern(
&re,
- Z_STRVAL_P(arg_pattern),
- Z_STRLEN_P(arg_pattern),
+ arg_pattern,
+ arg_pattern_len,
option, MBSTRG(current_mbctype) TSRMLS_CC);
if (err) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php