Skip to content

Commit a905b13

Browse files
committed
Merge pull request #1832 from mgreter/bugfix/segfault-nested-properties
Prevent segfault with nested properties edge case
2 parents b9766ba + ab94320 commit a905b13

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cssize.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ namespace Sass {
100100
// rr->tabs(r->block()->tabs());
101101
p_stack.pop_back();
102102

103+
if (!rr->block()) {
104+
error("Illegal nesting: Only properties may be nested beneath properties.", r->block()->pstate());
105+
}
106+
103107
Block* props = SASS_MEMORY_NEW(ctx.mem, Block, rr->block()->pstate());
104108
Block* rules = SASS_MEMORY_NEW(ctx.mem, Block, rr->block()->pstate());
105109
for (size_t i = 0, L = rr->block()->length(); i < L; i++)

0 commit comments

Comments
 (0)