Commit 2bd6360e authored by Hiroshi Ioka's avatar Hiroshi Ioka Committed by Brad Fitzpatrick

net/mail: fix wrong error message in consumePhrase

Fixes #19415

Change-Id: I6414f82e42bd09f1793156befce326aeac919ea2
Reviewed-on: https://go-review.googlesource.com/37911Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent c797256a
......@@ -393,7 +393,7 @@ func (p *addrParser) consumePhrase() (phrase string, err error) {
var word string
p.skipSpace()
if p.empty() {
return "", errors.New("mail: missing phrase")
break
}
isEncoded := false
if p.peek() == '"' {
......
......@@ -136,6 +136,7 @@ func TestAddressParsingError(t *testing.T) {
4: {"\"\\" + string([]byte{0x80}) + "\" <escaped-invalid-unicode@example.net>", "invalid utf-8 in quoted-string"},
5: {"\"\x00\" <null@example.net>", "bad character in quoted-string"},
6: {"\"\\\x00\" <escaped-null@example.net>", "bad character in quoted-string"},
7: {"John Doe", "no angle-addr"},
}
for i, tc := range mustErrTestCases {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment