Subject: | invalid long charset causing Mail::Message::Field stack overflow |
Looks like that this issue has been there for some time. An invalid
extremely long charset (sample message attached) will make
Mail::Message::Field stack overflow. Changing the regex in attribute()
fixed it.
--- Mail/Message/Field.pm~ 2011-02-16 17:07:48.000000000 -0800
+++ Mail/Message/Field.pm 2011-06-28
20:44:23.000000000 -0700
@@ -254,7 +254,7 @@
(my $quoted = $value) =~ s/(["\\])/\\$1/g;
for($body)
- { s/\b$attr\s*=\s*"(?>[^\\"]|\\.)*"/$attr="$quoted"/i
+ { s/\b$attr\s*=\s*"(?>[^\\"]|\\.){0,2048}"/$attr="$quoted"/i
or s/\b$attr\s*=\s*[^;\s]*/$attr="$quoted"/i
or do { $_ .= qq(; $attr="$quoted") }
}
Subject: | invalid-long-charset.eml |
Message body is not shown because it is too large.