diff options
| author | opsu <50782355+opsuu@users.noreply.github.com> | 2023-03-05 20:16:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-05 18:16:42 +0000 |
| commit | 0c8d1ba4a8f1a5106b15c2a61c70cd27d966d546 (patch) | |
| tree | de8eb3291defa0016330c661223adaabfc61ce53 /src/helpers/MiscFunctions.cpp | |
| parent | 7ce92f93ad4d975396e273c30ba8e345cca379ee (diff) | |
Buffer overflow fix (#1707)
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
| -rw-r--r-- | src/helpers/MiscFunctions.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 10d59316..ab3c826e 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -209,7 +209,7 @@ std::string removeBeginEndSpacesTabs(std::string str) { } int countAfter = 0; - while (str.length() != 0 && (str[str.length() - countAfter - 1] == ' ' || str[str.length() - 1 - countAfter] == '\t')) { + while ((int)str.length() - countAfter - 1 >= 0 && (str[str.length() - countAfter - 1] == ' ' || str[str.length() - 1 - countAfter] == '\t')) { countAfter++; } @@ -562,4 +562,4 @@ std::string replaceInString(std::string subject, const std::string& search, cons pos += replace.length(); } return subject; -}
\ No newline at end of file +} |
