mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 18:46:00 +01:00
workspace: fix integer overflow in selector parser (#5177)
This commit is contained in:
parent
8593c45be3
commit
95ac8a34b1
1 changed files with 2 additions and 2 deletions
|
@ -218,7 +218,7 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) {
|
|||
|
||||
const auto NEXTSPACE = selector.find_first_of(' ', i);
|
||||
std::string prop = selector.substr(i, NEXTSPACE == std::string::npos ? std::string::npos : NEXTSPACE - i);
|
||||
i = NEXTSPACE;
|
||||
i = std::min(NEXTSPACE, std::string::npos - 1);
|
||||
|
||||
if (cur == 'r') {
|
||||
int from = 0, to = 0;
|
||||
|
@ -383,4 +383,4 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) {
|
|||
|
||||
UNREACHABLE();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue