From a5422167cfcf8aaf92d3f65b720411167d082ccf Mon Sep 17 00:00:00 2001 From: norepro Date: Wed, 5 Aug 2026 22:26:52 -0700 Subject: [PATCH 1/2] Return None on mtime overflow --- src/tab.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tab.rs b/src/tab.rs index 0da0db2..89ad3c0 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -1909,7 +1909,7 @@ impl ItemMetadata { Self::Path { metadata, .. } => metadata.modified().ok(), #[cfg(feature = "gvfs")] Self::GvfsPath { mtime, .. } => { - Some(SystemTime::UNIX_EPOCH + Duration::from_secs(*mtime)) + SystemTime::UNIX_EPOCH.checked_add(Duration::from_secs(*mtime)) } _ => None, } From eebf5a9d4c458a40e5cb558519a483834ac118e3 Mon Sep 17 00:00:00 2001 From: Will Sheehan Date: Wed, 19 Aug 2026 21:46:45 -0700 Subject: [PATCH 2/2] do not panic in truly invalid timestamps --- src/tab.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tab.rs b/src/tab.rs index 89ad3c0..d11a170 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -437,7 +437,9 @@ impl<'a> FormatTime<'a> { impl Display for FormatTime<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let zoned = jiff::Zoned::try_from(self.time).unwrap(); + let Ok(zoned) = jiff::Zoned::try_from(self.time) else { + return Ok(()); + }; let now = jiff::Zoned::now(); let icu_datetime = DateTime::convert_from(zoned.datetime()); if zoned.date() == now.date() {