]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0913: no error check for neg values for 'messagesopt' v9.1.0913
authorh-east <h.east.727@gmail.com>
Sun, 8 Dec 2024 09:05:26 +0000 (10:05 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 8 Dec 2024 09:08:48 +0000 (10:08 +0100)
Problem:  no error check for neg values for 'messagesopt'
          (after v9.1.0908)
Solution: add additional error checks and tests (h-east)

closes: #16187

Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/message.c
src/testdir/gen_opt_test.vim
src/version.c

index f0d1806c6037caaca32b45452f4c8e65e7e61535..0fb0013d5ac1075c6d032c75d4634647cbd2668b 100644 (file)
@@ -1133,12 +1133,10 @@ messagesopt_changed(void)
     if (!(messages_flags_new & MESSAGES_HISTORY))
         return FAIL;
 
-    // "history" must be <= 10000
-    if (messages_history_new > 10000)
+    if (messages_history_new < 0 || messages_history_new > 10000)
         return FAIL;
 
-    // "wait" must be <= 10000
-    if (messages_wait_new > 10000)
+    if (messages_wait_new < 0 || messages_wait_new > 10000)
         return FAIL;
 
     msg_flags = messages_flags_new;
index 74f5ae52c9865cd8c5e3c1b69a42d796476e3e47..d1c721ef1bab521248a79398072029704e3f0725 100644 (file)
@@ -237,7 +237,9 @@ let test_values = {
       \                'hit-enter,history:1,wait:1'],
       \                ['xxx', 'history:500', 'hit-enter,history:-1',
       \                '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']],
       \ 'mouse': [['', 'n', 'v', 'i', 'c', 'h', 'a', 'r', 'nvi'],
       \                ['xxx', 'n,v,i']],
index 6dc9a47ec8d6fe6fa170ba644ea7569ecf5a7177..1333d9dea0fdc7994120a3e8693e3d5f78c26778 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    913,
 /**/
     912,
 /**/