From 406239dfc75a183955ec2f29ec40722a93af9f6c Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 12 Aug 2014 17:44:20 +0400 Subject: [PATCH] Fix potential buffer overrun --- lib/checkbufferoverrun.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index ea23d46be..49a4c4db8 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -1360,7 +1360,7 @@ MathLib::bigint CheckBufferOverrun::countSprintfLength(const std::string &input_ std::size_t parameterLength = 0; for (std::string::size_type i = 0; i < input_string.length(); ++i) { if (input_string[i] == '\\') { - if (input_string[i+1] == '0') + if (i < input_string.length() - 1 && input_string[i + 1] == '0') break; ++input_string_size;