stalwartlabs / mail-auth

DKIM, ARC, SPF and DMARC library for Rust
https://docs.rs/mail-auth/
Apache License 2.0
82 stars 13 forks source link

use defensive programming when handling keys #15

Closed edevil closed 1 year ago

edevil commented 1 year ago

We have little guarantees about key content at this time, so don't assume anything about it's size. Always verify indexed accesses.

mdecimus commented 1 year ago

Hi @djc - are you ok with merging this PR? It modifies one of the files you contributed. Thanks.

djc commented 1 year ago

@edevil oops, that's a pretty bad oversight on my part, thanks for reporting it! I submitted an alternative PR as #17 which IMO is a little cleaner/easier to follow, would be happy to get your review on it!

edevil commented 1 year ago

lgtm, thanks. :) I'll close this one.

mdecimus commented 1 year ago

Thank you @edevil and @djc ! Will merge #17 now.