Fix off-by-one in bodystructure parsing triggered by servers sending
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 4 Nov 2007 10:12:58 +0000 (10:12 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 4 Nov 2007 10:12:58 +0000 (10:12 +0000)
a body location part (e.g. Sun Java System Messaging Server). Thanks
John Callahan (#1808382).

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12758 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
class/mime/Message.class.php

index 8d1a77bc269c9547cdca344d5f3adc5a722aca04..c8088c9c864ba054ac171702658fdb6c0fb73759 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -229,6 +229,9 @@ Version 1.5.2 - SVN
     "not defined" error on session timeouts.
   - Allow custom session handlers to work correctly (and be defined at the
     application level with SquirrelMail).
+  - Fix off-by-one in bodystructure parsing triggered by servers sending
+    a body location part (e.g. Sun Java System Messaging Server). Thanks
+    John Callahan (#1808382).
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------
index 87449abb10de4da8cd6cccf00a9eca5833cfd9cf..dc12c19750cfa365629fd5878b4a4b0df5e491bf 100644 (file)
@@ -820,7 +820,7 @@ class Message {
      * @return integer
      */
     function parseParenthesis($read, $i) {
-        for (; $read{$i} != ')'; ++$i) {
+        for ($i++; $read{$i} != ')'; ++$i) {
             switch ($read{$i}) {
                 case '"': $this->parseQuote($read, $i); break;
                 case '{': $this->parseLiteral($read, $i); break;