From: <pdo...@us...> - 2010-09-03 02:45:43
|
Revision: 14055 http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=14055&view=rev Author: pdontthink Date: 2010-09-03 02:45:37 +0000 (Fri, 03 Sep 2010) Log Message: ----------- Fixed system lock-ups caused by a combination of certain rare, malformed message headers and buggy versions of PHP mbstring (#3053349). Modified Paths: -------------- branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog branches/SM-1_4-STABLE/squirrelmail/functions/strings.php Modified: branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog =================================================================== --- branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog 2010-08-24 21:36:01 UTC (rev 14054) +++ branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog 2010-09-03 02:45:37 UTC (rev 14055) @@ -4,17 +4,20 @@ Version 1.4.22 - SVN -------------------- + - Fixed system lock-ups caused by a combination of certain rare, + malformed message headers and buggy versions of PHP mbstring + (#3053349). Version 1.4.21 - 23 Jul 2010 ---------------------------- - Now allow more than one plugin to control the compose form submit action. - When sorting by received date, the received date is now shown on the message list. - - Explicitly disable browser caching for left_main and right_main pages + - Explicitly disabled browser caching for left_main and right_main pages (#2983134). - - Fix error with SpamCop reporting plugin not being able to send report as - emails (#1795310). - - Fix typo in SpamCop plugin. + - Fixed error with SpamCop reporting plugin not being able to send report + as emails (#1795310). + - Fixed typo in SpamCop plugin. - Reduced default time security tokens stay valid from 30 days to 2 days (reduces chances of session data growing too large) - Several speed enhancements for recent fixes regarding the display of Modified: branches/SM-1_4-STABLE/squirrelmail/functions/strings.php =================================================================== --- branches/SM-1_4-STABLE/squirrelmail/functions/strings.php 2010-08-24 21:36:01 UTC (rev 14054) +++ branches/SM-1_4-STABLE/squirrelmail/functions/strings.php 2010-09-03 02:45:37 UTC (rev 14055) @@ -187,11 +187,20 @@ if ($html_entities_as_chars) { + // $loop_count is needed to prevent an endless loop + // which is caused by buggy mbstring versions that + // return 0 (zero) instead of FALSE in some rare + // cases. Thanks, PHP. + // see: http://bugs.php.net/bug.php?id=52731 + // also: tracker $3053349 + // + $loop_count = 0; $entity_pos = $entity_end_pos = -1; while ($entity_end_pos + 1 < $actual_strlen && ($entity_pos = sq_strpos($string, '&', $entity_end_pos + 1)) !== FALSE && ($entity_end_pos = sq_strpos($string, ';', $entity_pos)) !== FALSE - && $entity_pos <= $adjusted_max_chars) + && $entity_pos <= $adjusted_max_chars + && $loop_count++ < $max_chars) { $adjusted_max_chars += $entity_end_pos - $entity_pos; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |