Bug #8335: Fix reading 0-length literals
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 11 Jun 2009 09:40:31 +0000 (03:40 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 11 Jun 2009 09:40:31 +0000 (03:40 -0600)
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index d00bbe5..6405b2d 100644 (file)
@@ -3220,6 +3220,11 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 }
             } while ($tmp !== false);
         } else {
+            // Skip 0-length literal data
+            if (!$len) {
+                return $data;
+            }
+
             while ($len && ($in = fread($this->_stream, min($len, 8192)))) {
                 $data .= $in;
                 $in_len = strlen($in);