From e1f8c63064fa9d981fc83bf3b6bd8f79883cf586 Mon Sep 17 00:00:00 2001 From: mortezadadgar Date: Tue, 1 Aug 2023 09:45:53 +0330 Subject: [PATCH] Fix possible OOB access for clicking tags specify the signed type for indexing tags as intended for `tag >= 0` check. Signed-off-by: mortezadadgar --- src/bar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bar.cpp b/src/bar.cpp index 507ce62..af92f49 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -181,7 +181,7 @@ void Bar::click(Monitor* mon, int x, int, int btn) control = ClkWinTitle; } else if (x > _layoutCmp.x) { control = ClkLayoutSymbol; - } else for (auto tag = _tags.size()-1; tag >= 0; tag--) { + } else for (int tag = _tags.size()-1; tag >= 0; tag--) { if (x > _tags[tag].component.x) { control = ClkTagBar; arg.ui = 1<