Fix potential buffer overrun

This commit is contained in:
Dmitry-Me 2014-08-12 17:44:20 +04:00
parent 263582ddbd
commit 406239dfc7
1 changed files with 1 additions and 1 deletions

View File

@ -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;