:: commit 3dd9a74003ff848f735428045181b8cda21b934b

Mintsuki <mintsuki@protonmail.com> — 2026-01-04 14:38

parents: fa1e901bd5

menu: Add bounds check to DELETE key handler

diff --git a/common/menu.c b/common/menu.c
index 43478265..563411bb 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -493,7 +493,7 @@ tab_part:
             if (cursor_offset) {
                 cursor_offset--;
         case GETCHAR_DELETE:
-                for (size_t i = cursor_offset; ; i++) {
+                for (size_t i = cursor_offset; i < buffer_len; i++) {
                     buffer[i] = buffer[i+1];
                     if (!buffer[i])
                         break;
tab: 248 wrap: offon