eleith/emailjs — pull request #41 by tedeh (2012-07-30 09:18:36+00:00)
Title: Fix for two conditional statements relating to address parsing in smtp/address.js

I'm attaching a pretty simple fix that prevents emailjs from getting stuck in an infinite loop (100 % CPU and increasing memory consumption until an allocation error terminates it) when it encounters an email address that is both invalid like `john@smith@example.com` and has a UTF-8 name encoded as base64 such as `"=?UTF-8?B?w7bDtsO2?="`. The problem arises from the fact that `Address.prototype.getphraselist` always returns an Array and `Boolean([])` equals `true` and not `false` (therefore testing for length of the Array instead).