Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfRangeException in MimeKit.InternetAddress.TryParseMailbox #421

Closed
sbukhtiyarov opened this issue Jul 26, 2018 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@sbukhtiyarov
Copy link

sbukhtiyarov commented Jul 26, 2018

An invalid header, similar to the one below, throw System.IndexOutOfRangeException in message parser.
Example:
Reply-To: "Name" <

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at MimeKit.InternetAddress.TryParseMailbox(ParserOptions options, Byte[] text, Int32 startIndex, Int32& index, Int32 endIndex, String name, Int32 codepage, Boolean throwOnError, InternetAddress& address)
   at MimeKit.InternetAddress.TryParse(ParserOptions options, Byte[] text, Int32& index, Int32 endIndex, AddressParserFlags flags, InternetAddress& address)
   at MimeKit.InternetAddressList.TryParse(ParserOptions options, Byte[] text, Int32& index, Int32 endIndex, Boolean isGroup, Boolean throwOnError, List`1& addresses)
   at MimeKit.MimeMessage.AddAddresses(Header header, InternetAddressList list)
   at MimeKit.MimeMessage.HeadersChanged(Object o, HeaderListChangedEventArgs e)
   at MimeKit.HeaderList.OnChanged(Header header, HeaderListChangedAction action)
   at MimeKit.HeaderList.Add(Header header)
   at MimeKit.MimeMessage..ctor(ParserOptions options, IEnumerable`1 headers, RfcComplianceMode mode)
   at MimeKit.MimeParser.ParseMessage(Byte* inbuf)
   at MimeKit.MimeParser.ParseMessage(CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapEngine.ParseMessage(Stream stream, Boolean persistent, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapFolder.ParseMessage(Stream stream, CancellationToken cancellationToken)
   at MailKit.Net.Imap.ImapFolder.GetMessage(UniqueId uid, CancellationToken cancellationToken, ITransferProgress progress)

jstedfast added a commit that referenced this issue Jul 26, 2018
@jstedfast jstedfast added the bug Something isn't working label Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants