mirror of
https://github.com/chatmail/relay.git
synced 2026-09-12 18:33:15 +00:00
refactor: get rid of indexing and slicing in check_armored_payload() (#15)
Indexing can potentially panic, without indexing it is easier to make sure there will be no crash.
This commit is contained in:
@@ -116,7 +116,7 @@ pub fn check_encrypted(mail: &mailparse::ParsedMail, outgoing: bool) -> bool {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
if !check_armored_payload(payload, outgoing) {
|
||||
if !check_armored_payload(&payload, outgoing) {
|
||||
log::debug!("check_encrypted: armored payload check failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user