From c385740087af1cd6c5715556381f435685ffc07f Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 3 Jan 2017 01:21:38 +0000 Subject: [PATCH] Fix a dereference of an iterator one past the end. --- src/expr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expr.cpp b/src/expr.cpp index 7bc2cf5d..03caa216 100644 --- a/src/expr.cpp +++ b/src/expr.cpp @@ -684,7 +684,7 @@ ExprParser::Token ExprParser::LexNumber(std::string *error) { double d = strtod(s.c_str(), &endptr); Token t = Token::From(); - if(endptr == &*s.end()) { + if(endptr == s.c_str() + s.size()) { t = Token::From(TokenType::OPERAND, Expr::Op::CONSTANT); t.expr->v = d; } else {