From 30be03d61b3875b7d9a58572e9a4c3315d494f33 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Thu, 26 Dec 2024 19:28:26 +0300 Subject: [PATCH] Assert input field buffer is nul-terminated. --- src/common/field.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/field.c b/src/common/field.c index 5d65f56be..6c11d33b6 100644 --- a/src/common/field.c +++ b/src/common/field.c @@ -93,6 +93,7 @@ bool IF_KeyEvent(inputField_t *field, int key) while (field->text[pos] > 32) { pos++; } + Q_assert(pos < sizeof(field->text)); memmove(field->text + field->cursorPos, field->text + pos, sizeof(field->text) - pos); return true;