diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-02-08 13:44:53 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-02-08 23:55:47 +0200 |
commit | 6afac835e00499b4438ebb8b4fabdf836308bcef (patch) | |
tree | d406fd4d6fd61a3228f857d27dcae7ed4d347853 /melib/src/email/parser.rs | |
parent | eb501b6d501f5bab8f81a4a9d15526d820cac2b6 (diff) |
melib/datetime: fix overflow panic on early date input
Diffstat (limited to 'melib/src/email/parser.rs')
-rw-r--r-- | melib/src/email/parser.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/melib/src/email/parser.rs b/melib/src/email/parser.rs index 6874f88f..8df71c01 100644 --- a/melib/src/email/parser.rs +++ b/melib/src/email/parser.rs @@ -1052,7 +1052,7 @@ mod tests { use crate::make_address; #[test] - fn test_subject() { + fn test_phrase() { let words = b"=?iso-8859-7?B?W215Y291cnNlcy5udHVhLmdyIC0gyvXs4fTp6t4g6uHpIMri4e306ere?= =?iso-8859-7?B?INb18+nq3l0gzd3hIMHt4erv3+358+c6IMzF0c/TIMHQz9TFy8XTzMHU?= =?iso-8859-7?B?2c0gwiDUzC4gysHNLiDFzsXUwdPH0yAyMDE3LTE4OiDTx8zFydnTxw==?="; @@ -1145,7 +1145,10 @@ mod tests { debug!("{:?}", date(__s)); assert_eq!(date(s).unwrap(), date(_s).unwrap()); assert_eq!(date(_s).unwrap(), date(__s).unwrap()); + let val = b"Fri, 23 Dec 0001 21:20:36 -0800 (PST)"; + assert_eq!(date(val).unwrap(), 0); } + #[test] fn test_attachments() { //FIXME: add file |