From 643e2539346e3ac3d394ff73962b856bebbc552b Mon Sep 17 00:00:00 2001 From: xzyfer Date: Sat, 18 Feb 2017 14:32:19 +1100 Subject: [PATCH 1/3] Fix possible null pointrt --- src/environment.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index 7a7e9b1d19..99ff223898 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -128,8 +128,9 @@ namespace Sass { template void Environment::set_lexical(const std::string& key, T val) { - auto cur = this; bool shadow = false; - while (cur->is_lexical() || shadow) { + auto cur = this; + bool shadow = false; + while ((cur && cur->is_lexical()) || shadow) { if (cur->has_local(key)) { cur->set_local(key, val); return; From bf159b1b043b2b52617a0cb4dc3a7f69c2cad24b Mon Sep 17 00:00:00 2001 From: xzyfer Date: Sat, 18 Feb 2017 14:32:36 +1100 Subject: [PATCH 2/3] Fix possible null pointer --- src/extend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extend.cpp b/src/extend.cpp index 5c5c565c2b..9341d8d59f 100644 --- a/src/extend.cpp +++ b/src/extend.cpp @@ -2081,7 +2081,7 @@ namespace Sass { error("\"" + str_sel + "\" failed to @extend \"" + str_ext + "\".\n" "The selector \"" + str_ext + "\" was not found.\n" "Use \"@extend " + str_ext + " !optional\" if the" - " extend should be able to fail.", ext->pstate()); + " extend should be able to fail.", (ext ? ext->pstate() : NULL)); } } From 482b16aaf3daf38619dd6c27017778ca52d62142 Mon Sep 17 00:00:00 2001 From: xzyfer Date: Sat, 18 Feb 2017 14:32:52 +1100 Subject: [PATCH 3/3] Fix dead assignment --- src/parser.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/parser.cpp b/src/parser.cpp index 0f4f215598..7d0e29f94a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1272,7 +1272,6 @@ namespace Sass { bool right_ws = peek < css_comments >() != NULL; operators.push_back({ op, left_ws, right_ws }); operands.push_back(parse_expression()); - left_ws = peek < css_comments >() != NULL; } // we are called recursively for list, so we first // fold inner binary expression which has delayed