PHP 4.0 Bug #8421 Updated: preg_split() reproduce crash if (argc == 1)
| From: | andrei@php.net | Date: | Wed, 27 Dec 2000 14:00:09 +0000 |
| Subject: | PHP 4.0 Bug #8421 Updated: preg_split() reproduce crash if (argc == 1) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42314@lists.php.net to get a copy of this message | ||
ID: 8421
Updated by: andrei
Reported By: sagawa@sohgoh.net
Old-Status: Open
Status: Closed
Bug Type: PCRE related
Assigned To:
Comments:
Fixed in CVS.
Previous Comments:
---------------------------------------------------------------------------
[2000-12-26 04:03:11] sagawa@sohgoh.net
When preg_split's argc is only 1, like preg_split("/foo/"),
reproduce crash.
The cause of this problem is to forget the check of argc==1
in ext/pcre/php_pcre.c line 1070.
1068 /* Get function parameters and do error checking */
1069 argc = ZEND_NUM_ARGS();
1070 if (argc < 1 || argc > 4 ||
zend_get_parameters_ex(argc, ®ex, &subject, &limit,
&flags) == FAILURE) {
1071 WRONG_PARAM_COUNT;
1072 }
Thus this should be
1070 if (argc < 2 || argc >4 || ...
This problem reason is very clear, so I don't attach gdb
backtrace. Thank you.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8421