Skip to content

Commit 24cdc8f

Browse files
committed
Fix segault when while predicate is missing
Originally reported by @MrTuxracer Spec sass/sass-spec#1103
1 parent 065b646 commit 24cdc8f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/parser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,9 @@ namespace Sass {
21422142
While_Obj call = SASS_MEMORY_NEW(While, pstate, 0, 0);
21432143
// parse mandatory predicate
21442144
Expression_Obj predicate = parse_list();
2145+
if (Cast<List>(predicate)->length() == 0) {
2146+
css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was ", false);
2147+
}
21452148
call->predicate(predicate);
21462149
// parse mandatory block
21472150
call->block(parse_block(root));

0 commit comments

Comments
 (0)