Frederick888 / external-editor-revived

External Editor Revived is a Thunderbird MailExtension which allows editing emails in programs such as Vim, Neovim, Emacs, etc.
GNU General Public License v3.0
110 stars 6 forks source link

fix(host): Fix crashes when EML has invalid UTF-8 #68

Closed Frederick888 closed 1 year ago

Frederick888 commented 1 year ago

Description

c8a428d fix(host): Fix crashes when EML has invalid UTF-8

While input from Thunderbird is always sanitised, users can add random things into the temporary EML file. And when there are invalid UTF-8 sequences in the file, read_line() fails as it cannot convert it to String.

Since Thunderbird sanitises outgoing emails as well, we don't need to bother sending the very original contents to Thunderbird. Simply from_utf8_lossy() should suffice.

Checklist

Is this a breaking change?

No.

Test results

Fixes #65