mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
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:
parent
fe1e2eff06
commit
ca4f688ad4
@ -1098,11 +1098,13 @@ int messagesopt_changed(void)
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(messages_history_new >= 0);
|
||||||
// "history" must be <= 10000
|
// "history" must be <= 10000
|
||||||
if (messages_history_new > 10000) {
|
if (messages_history_new > 10000) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(messages_wait_new >= 0);
|
||||||
// "wait" must be <= 10000
|
// "wait" must be <= 10000
|
||||||
if (messages_wait_new > 10000) {
|
if (messages_wait_new > 10000) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@ -268,7 +268,9 @@ let test_values = {
|
|||||||
\ 'hit-enter,history:1,wait:1'],
|
\ 'hit-enter,history:1,wait:1'],
|
||||||
\ ['xxx', 'history:500', 'hit-enter,history:-1',
|
\ ['xxx', 'history:500', 'hit-enter,history:-1',
|
||||||
\ 'hit-enter,history:10001', 'history:0,wait:10001',
|
\ 'hit-enter,history:10001', 'history:0,wait:10001',
|
||||||
\ 'hit-enter']],
|
\ 'hit-enter', 'history:10,wait:99999999999999999999',
|
||||||
|
\ 'history:99999999999999999999,wait:10', 'wait:10',
|
||||||
|
\ 'history:-10', 'history:10,wait:-10']],
|
||||||
\ 'mkspellmem': [['10000,100,12'], ['', 'xxx', '10000,100']],
|
\ 'mkspellmem': [['10000,100,12'], ['', 'xxx', '10000,100']],
|
||||||
\ 'mouse': [['', 'n', 'v', 'i', 'c', 'h', 'a', 'r', 'nvi'],
|
\ 'mouse': [['', 'n', 'v', 'i', 'c', 'h', 'a', 'r', 'nvi'],
|
||||||
\ ['xxx', 'n,v,i']],
|
\ ['xxx', 'n,v,i']],
|
||||||
|
Loading…
Reference in New Issue
Block a user