MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.61k stars 627 forks source link

MCMessageParser - call on line 64 to data_message_init can fail #1624

Open tomandersen opened 7 years ago

tomandersen commented 7 years ago

https://github.com/MailCore/mailcore2/blob/master/src/core/rfc822/MCMessageParser.cpp

line 64.

data_message_init can fail, (ie for really bad input). It will return nil. The next line will crash.

I don't see exactly what to do if that code section gets into trouble. Its called on construction, returning null might not be an option.

--tom

dinhvh commented 7 years ago

Can you try to change that code to call: data_message_init() with empty data when it fails to see if it helps?

dinhvh commented 7 years ago

And if it works, could you submit a pull request? It would be neat! Thanks!

shenchao12344 commented 7 years ago

I also have this problem,how to solve it.Thank You