Skip to content

Commit

Permalink
fix overflow in string.split, close #101 (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
qaqland authored Sep 7, 2024
1 parent e0bb9e2 commit 692dc39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/compiler/src/builtin/functions/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub(crate) fn str_split(mut args: ArgumentResult, visitor: &mut Visitor) -> Sass
.into());
}
// note: `1 + limit_int` is required to match dart-sass
s1.splitn(1 + limit_int as usize, &separator)
s1.splitn(limit_int.saturating_add(1) as usize, &separator)
.map(|s| Value::String(s.to_string(), QuoteKind::Quoted))
.collect()
};
Expand Down

0 comments on commit 692dc39

Please sign in to comment.