Skip to content

Commit 4454eb6

Browse files
authored
Merge pull request #2336 from xzyfer/additional-hardening
Additional hardening
2 parents be07f99 + 482b16a commit 4454eb6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/environment.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ namespace Sass {
128128
template <typename T>
129129
void Environment<T>::set_lexical(const std::string& key, T val)
130130
{
131-
auto cur = this; bool shadow = false;
132-
while (cur->is_lexical() || shadow) {
131+
auto cur = this;
132+
bool shadow = false;
133+
while ((cur && cur->is_lexical()) || shadow) {
133134
if (cur->has_local(key)) {
134135
cur->set_local(key, val);
135136
return;

src/extend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,7 @@ namespace Sass {
20812081
error("\"" + str_sel + "\" failed to @extend \"" + str_ext + "\".\n"
20822082
"The selector \"" + str_ext + "\" was not found.\n"
20832083
"Use \"@extend " + str_ext + " !optional\" if the"
2084-
" extend should be able to fail.", ext->pstate());
2084+
" extend should be able to fail.", (ext ? ext->pstate() : NULL));
20852085
}
20862086
}
20872087

src/parser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,6 @@ namespace Sass {
12721272
bool right_ws = peek < css_comments >() != NULL;
12731273
operators.push_back({ op, left_ws, right_ws });
12741274
operands.push_back(parse_expression());
1275-
left_ws = peek < css_comments >() != NULL;
12761275
}
12771276
// we are called recursively for list, so we first
12781277
// fold inner binary expression which has delayed

0 commit comments

Comments
 (0)