1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 16:38:25 +02:00

Added overflow checks to wordwrap() function.

This commit is contained in:
Ilia Alshanetsky
2006-03-13 14:37:10 +00:00
parent c69f100d0e
commit 80ea07d30c
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Mar 2006, PHP 5.1.3RC2
- Added overflow checks to wordwrap() function. (Ilia)
- Removed the E_STRICT deprecation notice from "var". (Ilia)
- Fixed debug_zval_dump() to support private and protected members. (Dmitry)
- Fixed bug #36629 (SoapServer::handle() exits on SOAP faults). (Dmitry)
+2 -1
View File
@@ -676,12 +676,13 @@ PHP_FUNCTION(wordwrap)
/* Multiple character line break or forced cut */
if (linelength > 0) {
chk = (int)(textlen/linelength + 1);
newtext = safe_emalloc(chk, breakcharlen, textlen + 1);
alloced = textlen + chk * breakcharlen + 1;
} else {
chk = textlen;
alloced = textlen * (breakcharlen + 1) + 1;
newtext = safe_emalloc(textlen, (breakcharlen + 1), 1);
}
newtext = emalloc(alloced);
/* now keep track of the actual new text length */
newtextlen = 0;