Skip to content

Commit bf6ccae

Browse files
authored
Fix stack-overflow in Binary_Expression (#3058)
1 parent 7a21c79 commit bf6ccae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/parser.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,6 +2849,13 @@ namespace Sass {
28492849
}
28502850
}
28512851

2852+
if (operands.size() > Constants::MaxCallStack) {
2853+
// XXX: this is never hit via spec tests
2854+
sass::ostream stm;
2855+
stm << "Stack depth exceeded max of " << Constants::MaxCallStack;
2856+
error(stm.str());
2857+
}
2858+
28522859
for (size_t S = operands.size(); i < S; ++i) {
28532860
if (String_Schema* schema = Cast<String_Schema>(operands[i])) {
28542861
if (schema->has_interpolants()) {

0 commit comments

Comments
 (0)