#1271 Busy infinite loop in parseAddress

Folders (317)

(using squirrelmail 1.4.0, server/php/imap irrelevant;
I couldn't find another bug dealing with this)



And you've got yourself a busy loop (the while will be
executed everytime with $pos remaining 1 and $j
remaining 3).

Though 'a<b' in syntactically incorrect for an
emailadress, parseAddress shouldn't be busylooping on it.

This error is still inside 1.142 of imap_general.php
(the current HEAD)

In order to provably prevent a busy loop, $pos - $j
should always be increasing, whatever happens inside
the while.
This is ensured in most switch-cases, only in the '<'
case there is neither an increasing $pos, nor an
decreasing $j. In the ':'-case it's not easy to check
because of the recursive call, but it looks okay.


  • Thijs Kinkhorst

    Thijs Kinkhorst - 2003-05-24
    • assigned_to: nobody --> kink
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2003-05-25

    Logged In: YES

    Thanks for reporting; the problem was indeed that when no
    closing > was present, strpos would return false. $pos was
    increased by the strlen between < and >, with the second
    false, this means 0. The special case where strpos is false
    has been caught now.

  • Thijs Kinkhorst

    Thijs Kinkhorst - 2003-05-25
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks