vim-patch:9.1.0913: no error check for neg values for 'messagesopt' (#31511)

Problem:  no error check for neg values for 'messagesopt'
          (after v9.1.0908)
Solution: add additional error checks and tests (h-east)

closes: vim/vim#16187

65be834c30

Nvim's getdigits() checks for overflow, so the code change isn't needed.

Co-authored-by: h-east <h.east.727@gmail.com>
This commit is contained in:
zeertzjq
2024-12-08 17:53:01 +08:00
committed by GitHub
parent fe1e2eff06
commit ca4f688ad4
2 changed files with 5 additions and 1 deletions

View File

@@ -1098,11 +1098,13 @@ int messagesopt_changed(void)
return FAIL;
}
assert(messages_history_new >= 0);
// "history" must be <= 10000
if (messages_history_new > 10000) {
return FAIL;
}
assert(messages_wait_new >= 0);
// "wait" must be <= 10000
if (messages_wait_new > 10000) {
return FAIL;