Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for two conditional statements relating to address parsing in smtp/address.js #41

Merged
merged 1 commit into from

2 participants

@tedeh

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).

@eleith eleith merged commit 1c0021c into eleith:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 30, 2012
  1. @tedeh
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 smtp/address.js
View
6 smtp/address.js
@@ -93,7 +93,7 @@ Address.prototype =
if(this.pos >= this.field.length)
{
// Bad email address, no domain
- if(plist)
+ if(plist.length)
returnlist = [{label:this.commentlist.join(SPACE), address:plist[0]}];
}
@@ -142,11 +142,11 @@ Address.prototype =
else
{
- if(plist)
+ if(plist.length)
returnlist = {label:this.commentlist.join(SPACE), address:plist[0]};
else if(this.specials.indexOf(this.field[this.pos]) != -1)
- this.post++;
+ this.pos++;
}
this.gotonext();
Something went wrong with that request. Please try again.