iliaa           Mon Mar 13 14:41:27 2006 UTC

  Modified files:              (Branch: PHP_4_4)
    /php-src/ext/standard       string.c 
    /php-src    NEWS 
  Log:
  MFH: Added overflow checks to wordwrap() function.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/string.c?r1=1.333.2.52.2.3&r2=1.333.2.52.2.4&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.333.2.52.2.3 
php-src/ext/standard/string.c:1.333.2.52.2.4
--- php-src/ext/standard/string.c:1.333.2.52.2.3        Sun Jan  1 13:46:58 2006
+++ php-src/ext/standard/string.c       Mon Mar 13 14:41:27 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.333.2.52.2.3 2006/01/01 13:46:58 sniper Exp $ */
+/* $Id: string.c,v 1.333.2.52.2.4 2006/03/13 14:41:27 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -672,15 +672,13 @@
                /* 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;
+                       newtext = safe_emalloc(textlen, (breakcharlen + 1), 1);
                        alloced = textlen * (breakcharlen + 1) + 1;
                }
-               if (alloced <= 0) {
-                       RETURN_FALSE;
-               }
-               newtext = emalloc(alloced);
 
                /* now keep track of the actual new text length */
                newtextlen = 0;
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.1247.2.920.2.119&r2=1.1247.2.920.2.120&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.119 php-src/NEWS:1.1247.2.920.2.120
--- php-src/NEWS:1.1247.2.920.2.119     Mon Mar  6 21:58:33 2006
+++ php-src/NEWS        Mon Mar 13 14:41:27 2006
@@ -2,6 +2,7 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2006, Version 4.4.3
 - Updated PCRE to version 6.6. (Andrei)
+- Added overflow checks to wordwrap() function. (Ilia)
 - Added a check for special characters in the session name. (Ilia)
 - Fixed bug #36459 (Incorrect adding PHPSESSID to links, which contains \r\n).
   (Ilia)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to