1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

date: fix panic when input will cause overflow (#5160)

* fix issue 5149

* fix clippy style issue

* fix spell issue

* address comment

* address comments

* fix cspell
This commit is contained in:
tommady 2023-08-20 22:55:38 +08:00 committed by GitHub
parent abffe6c768
commit b5746f794c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -395,3 +395,12 @@ fn test_invalid_date_string() {
.no_stdout()
.stderr_contains("invalid date");
}
#[test]
fn test_date_overflow() {
new_ucmd!()
.arg("-d68888888888888sms")
.fails()
.no_stdout()
.stderr_contains("invalid date");
}