mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-02 13:11:55 -07:00
Buffer overflow fix (#1707)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user