From a948b4f4b07b493b45353becba05579d2c2c0a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 15 Dec 2013 13:41:07 +0100 Subject: [PATCH] Revert "Preprocessor:removeParentheses: fixed potential buffer access out of bounds, if find returns std::string::npos." This reverts commit 4fbe15c8665ccc8431b13b85450361bacd72e74e. As far as I see there can't be buffer access out of bounds. line always contain a '('. --- lib/preprocessor.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 1543fa939..a5e97b205 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -819,11 +819,8 @@ std::string Preprocessor::removeParentheses(const std::string &str) --ind; if (ind == 0) { if (i == line.length() - 1) { - const std::string::size_type posIndx = line.find('('); - if (posIndx != std::string::npos) { - line[posIndx] = ' '; - line.erase(line.length() - 1); - } + line[line.find('(')] = ' '; + line.erase(line.length() - 1); } break; }