Skip to content

Commit bbb6e44

Browse files
committed
Mitigate possible segfault after invoking call fn
We accessed the hash map directly without checking for existence. This was creating the key with NULL assigned.
1 parent 9e332d7 commit bbb6e44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ namespace Sass {
15641564

15651565
Arguments* args = SASS_MEMORY_NEW(ctx.mem, Arguments, pstate);
15661566
std::string full_name(name + "[f]");
1567-
Definition* def = static_cast<Definition*>((d_env)[full_name]);
1567+
Definition* def = d_env.has(full_name) ? static_cast<Definition*>((d_env)[full_name]) : 0;
15681568
Parameters* params = def ? def->parameters() : 0;
15691569
size_t param_size = params ? params->length() : 0;
15701570
for (size_t i = 0, L = arglist->length(); i < L; ++i) {

0 commit comments

Comments
 (0)