Fix bug #67151: strtr with empty array crashes

This commit is contained in:
Nikita Popov 2014-07-02 22:31:52 +02:00
parent 5efda71e54
commit 3cc6bd10ac
2 changed files with 5 additions and 0 deletions

1
NEWS
View File

@ -9,6 +9,7 @@ PHP NEWS
match). (Bob)
. Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0).
(Ferenc)
. Fixed bug #67151 (strtr with empty array crashes). (Nikita)
- CLI server:
. Implemented FR #67429 (CLI server is missing some new HTTP response codes).

View File

@ -3155,6 +3155,10 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
int patterns_len;
zend_llist *allocs;
if (zend_hash_num_elements(pats) == 0) {
RETURN_STRINGL(str, slen, 1);
}
S(&text) = str;
L(&text) = slen;