diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-09-06 18:12:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-06 18:12:46 +0000 |
commit | aa8901e9bb0399d2c16f988ba2fe46eb0c0c5d13 (patch) | |
tree | 7e63b06d1eec92beec6997c9d3ab47a5d6a835be /libgo/go/net/mail/message.go | |
parent | 920ea3b8ba3164b61ac9490dfdfceb6936eda6dd (diff) |
libgo: update to Go 1.13beta1 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/193497
From-SVN: r275473
Diffstat (limited to 'libgo/go/net/mail/message.go')
-rw-r--r-- | libgo/go/net/mail/message.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libgo/go/net/mail/message.go b/libgo/go/net/mail/message.go index 554377aa1da..e0907806ca6 100644 --- a/libgo/go/net/mail/message.go +++ b/libgo/go/net/mail/message.go @@ -342,6 +342,21 @@ func (p *addrParser) parseAddress(handleGroup bool) ([]*Address, error) { } // angle-addr = "<" addr-spec ">" if !p.consume('<') { + atext := true + for _, r := range displayName { + if !isAtext(r, true, false) { + atext = false + break + } + } + if atext { + // The input is like "foo.bar"; it's possible the input + // meant to be "foo.bar@domain", or "foo.bar <...>". + return nil, errors.New("mail: missing '@' or angle-addr") + } + // The input is like "Full Name", which couldn't possibly be a + // valid email address if followed by "@domain"; the input + // likely meant to be "Full Name <...>". return nil, errors.New("mail: no angle-addr") } spec, err = p.consumeAddrSpec() |