Skip to content

Commit

Permalink
Assert input field buffer is nul-terminated.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet authored and res2k committed Jan 2, 2025
1 parent 61af7f7 commit 30be03d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/common/field.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 30be03d

Please sign in to comment.