Skip to content

Commit 54a9ef8

Browse files
cardigan1008ChristopherRabotin
authored andcommitted
fix: return error when prev_idx > end_idx
1 parent 93639d5 commit 54a9ef8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/epoch.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,10 @@ impl Epoch {
10501050
idx + 1
10511051
};
10521052

1053+
if prev_idx > end_idx {
1054+
return Err(Errors::ParseError(ParsingErrors::ISO8601));
1055+
}
1056+
10531057
match lexical_core::parse(s[prev_idx..end_idx].as_bytes()) {
10541058
Ok(val) => {
10551059
// Check that this valid is OK for the token we're reading it as.

0 commit comments

Comments
 (0)