Skip to content

Commit 3a27ecb

Browse files
mgreterxzyfer
authored andcommitted
Throw error on invalid vararg (avoid null ptr segv)
Fixes #2434
1 parent 13856f9 commit 3a27ecb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bind.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ namespace Sass {
218218
Map_Obj argmap = Cast<Map>(a->value());
219219

220220
for (auto key : argmap->keys()) {
221-
std::string param = "$" + unquote(Cast<String_Constant>(key)->value());
221+
String_Constant_Ptr val = Cast<String_Constant>(key);
222+
if (val == NULL) throw Exception::InvalidVarKwdType(key->pstate(), key->inspect(), a);
223+
std::string param = "$" + unquote(val->value());
222224

223225
if (!param_map.count(param)) {
224226
std::stringstream msg;

0 commit comments

Comments
 (0)