mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 22:51:58 -07:00
Buffer overflow fix (#1707)
This commit is contained in:
@@ -209,7 +209,7 @@ std::string removeBeginEndSpacesTabs(std::string str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int countAfter = 0;
|
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++;
|
countAfter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,4 +562,4 @@ std::string replaceInString(std::string subject, const std::string& search, cons
|
|||||||
pos += replace.length();
|
pos += replace.length();
|
||||||
}
|
}
|
||||||
return subject;
|
return subject;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user