aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/debug
diff options
context:
space:
mode:
authorbazuin-32 <[email protected]>2022-07-12 15:38:50 -0600
committerbazuin-32 <[email protected]>2022-07-12 15:38:50 -0600
commitac9ff795cdfd25c37b9b9be44f3d034bfa3284d3 (patch)
treee7807a49dc48463205d4415c7133ef4b386e495c /src/debug
parent4bea3467e03eae7c3db251b84605345c576c4313 (diff)
downloadHyprland-ac9ff795cdfd25c37b9b9be44f3d034bfa3284d3.tar.gz
Hyprland-ac9ff795cdfd25c37b9b9be44f3d034bfa3284d3.zip
Fix calls to `substr` with invalid `pos`
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/HyprCtl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 76fe3c56..684bca9c 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -526,7 +526,8 @@ std::string getReply(std::string request) {
format = HyprCtl::FORMAT_JSON;
}
- request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string
+ if (sepIndex < request.size())
+ request = request.substr(sepIndex + 1); // remove flags and separator so we can compare the rest of the string
if (request == "monitors")
return monitorsRequest(format);