tony2001 Thu Feb 15 09:31:01 2007 UTC Modified files: (Branch: PHP_4_4) /php-src/ext/standard string.c Log: fix possible off-by-one in str_(i)replace() http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.333.2.52.2.9&r2=1.333.2.52.2.10&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.333.2.52.2.9 php-src/ext/standard/string.c:1.333.2.52.2.10 --- php-src/ext/standard/string.c:1.333.2.52.2.9 Mon Jan 8 14:25:22 2007 +++ php-src/ext/standard/string.c Thu Feb 15 09:31:01 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.333.2.52.2.9 2007/01/08 14:25:22 iliaa Exp $ */ +/* $Id: string.c,v 1.333.2.52.2.10 2007/02/15 09:31:01 tony2001 Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2531,7 +2531,7 @@ } Z_STRLEN_P(result) = len + (char_count * (to_len - 1)); - Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len); + Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len + 1); Z_TYPE_P(result) = IS_STRING; for (source = str; source < source_end; source++) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php