zendframework / zend-mail

Mail component from Zend Framework
BSD 3-Clause "New" or "Revised" License
96 stars 111 forks source link

Infinite imap decodeLine while loop #240

Open jensstalder opened 5 years ago

jensstalder commented 5 years ago

I just got a case where a line as follows: [LIST (\HasNoChildren) "/" {54} caused the while loop to run indefinitely.

I suspect ist this space character appended, which will cause the while (($pos = strpos($line, ' ')) !== false) { to run indefinitely? Not a nice thing to happen ^^ .

https://github.com/zendframework/zend-mail/blob/ece418b37aaf8a98c991d7f0c198408043a2172d/src/Protocol/Imap.php#L217

Im guessing {54} is a prefix to say that the next 54 Characters could contain special chars: (in my case Aufgaben/to dos/Landingpage "meine Immobilie im Alter". It probably meant the quotes.

It seams to work when I remove the space on L217.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-mail; a new issue has been opened at https://github.com/laminas/laminas-mail/issues/11.