Skip to content

Commit a623f49

Browse files
authored
Merge pull request #2323 from mgreter/bugfix/issue-2321
Fix another null pointer access
2 parents aff5e8d + 1e960ab commit a623f49

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bind.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,15 @@ namespace Sass {
167167
else if (a->is_rest_argument()) {
168168
// normal param and rest arg
169169
List_Obj arglist = Cast<List>(a->value());
170+
if (!arglist) {
171+
if (Expression_Obj arg = Cast<Expression>(a->value())) {
172+
arglist = SASS_MEMORY_NEW(List, a->pstate(), 1);
173+
arglist->append(arg);
174+
}
175+
}
176+
170177
// empty rest arg - treat all args as default values
171-
if (!arglist->length()) {
178+
if (!arglist || !arglist->length()) {
172179
break;
173180
} else {
174181
if (arglist->length() > LP - ip && !ps->has_rest_parameter()) {

0 commit comments

Comments
 (0)