aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authoropsu <[email protected]>2023-03-05 20:16:42 +0200
committerGitHub <[email protected]>2023-03-05 18:16:42 +0000
commit0c8d1ba4a8f1a5106b15c2a61c70cd27d966d546 (patch)
treede8eb3291defa0016330c661223adaabfc61ce53 /src
parent7ce92f93ad4d975396e273c30ba8e345cca379ee (diff)
downloadHyprland-0c8d1ba4a8f1a5106b15c2a61c70cd27d966d546.tar.gz
Hyprland-0c8d1ba4a8f1a5106b15c2a61c70cd27d966d546.zip
Buffer overflow fix (#1707)
Diffstat (limited to 'src')
-rw-r--r--src/helpers/MiscFunctions.cpp4
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
+}