I can reproduce it. Seems to be off-by-one here:

Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len);

introduced by this patch:

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.36&r2=1.445.2.14.2.37
If I replace len with len+1, it seems to be OK.

Looking more on this code of php_char_to_str_ex, it seems very strange to me, especially this part:

        if (char_count == 0 && case_sensitivity) {
                ZVAL_STRINGL(result, str, len, 1);
                return 0;
        }

Why check case_sensitivity here? Looks like some code remained un-cleaned from previous versions. Any arguments against removing this check?
--
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED]  http://www.zend.com/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to