aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-12-08 17:53:01 +0800
committerGitHub <noreply@github.com>2024-12-08 17:53:01 +0800
commitca4f688ad4d6160e0ec0cb858a6559eb8a39b594 (patch)
tree9a9823776dc32bd47a29e351fbb865f7531b8a1c /src
parentfe1e2eff062605f7e617885011160a678822fd0c (diff)
downloadrneovim-ca4f688ad4d6160e0ec0cb858a6559eb8a39b594.tar.gz
rneovim-ca4f688ad4d6160e0ec0cb858a6559eb8a39b594.tar.bz2
rneovim-ca4f688ad4d6160e0ec0cb858a6559eb8a39b594.zip
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 https://github.com/vim/vim/commit/65be834c30fb43abb2e41585b41eefcd2ae06c01 Nvim's getdigits() checks for overflow, so the code change isn't needed. Co-authored-by: h-east <h.east.727@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index d8e6fd3001..edb332a786 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -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;