piknik icon indicating copy to clipboard operation
piknik copied to clipboard

Envelope deserialization doesn't catch empty forward_path

Open wyfo opened this issue 1 year ago • 1 comments

Describe the bug Envelope deserialization doesn't catch empty forward_path.

To Reproduce

serde_json::from_str::<Envelope>(r#"{"forward_path": []}"#).unwrap() // should panic, but don't

Expected behavior Deserializing envelope with empty forward_path should panic.

Environment (please complete the following information):

  • Lettre version: 0.10.0
  • OS: Ubuntu

Additional context I think I will open a PR to fix it soon (maybe tonight)

wyfo avatar Jul 25 '22 09:07 wyfo

@paolobarbolini would you consider adding a custom type like in https://serde.rs/custom-date-format.html to check for the vec length as a valid fix?

Agreon avatar Sep 30 '22 18:09 Agreon