]> Cypherpunks repositories - gostls13.git/commit
net/mail: skip empty entries in parseAddressList
authorTimmy Douglas <timmyd983@gmail.com>
Sat, 1 Feb 2020 22:14:30 +0000 (22:14 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 21 Feb 2020 18:18:25 +0000 (18:18 +0000)
commit30e3bf2051e1659ba7ea1d14849f79deb82a5606
tree6001cb146a89c5adbe0b3a628b6df1626c9a5ba1
parent9ca57923e222335cc63924833d5bf562962e06c9
net/mail: skip empty entries in parseAddressList

RFC 5322 has a section 4.4 where it says that address-list could
have "null" members: "That is, there could be two or more commas in
such a list with nothing in between them, or commas at the beginning
or end of the list." This change handles such a case so that mail
clients using this method on actual email messages get a reasonable
return value when they parse email.

Fixes #36959

Change-Id: I3ca240969935067262e3d751d376a06db1fef2a2
GitHub-Last-Rev: b96a9f2c075dfd67c3ff7b8ae0c12e12035f0da0
GitHub-Pull-Request: golang/go#36966
Reviewed-on: https://go-review.googlesource.com/c/go/+/217377
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
src/net/mail/message.go
src/net/mail/message_test.go