]> granicus.if.org Git - vim/commitdiff
patch 8.1.1509: cmdline_row can become negative, causing a crash v8.1.1509
authorBram Moolenaar <Bram@vim.org>
Sun, 9 Jun 2019 14:40:46 +0000 (16:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 9 Jun 2019 14:40:46 +0000 (16:40 +0200)
Problem:    Cmdline_row can become negative, causing a crash.
Solution:   Make sure cmdline_row does not become negagive. (closes #4102)

src/misc1.c
src/version.c

index 7ef7e78f07e9174db1919e68df906a40b9f6a6d6..f5549fdc52a72a2185b4e12ca077dd257d8e8a90 100644 (file)
@@ -1447,9 +1447,9 @@ prompt_for_number(int *mouse_used)
     i = get_number(TRUE, mouse_used);
     if (KeyTyped)
     {
-       /* don't call wait_return() now */
-       /* msg_putchar('\n'); */
-       cmdline_row = msg_row - 1;
+       // don't call wait_return() now
+       if (msg_row > 0)
+           cmdline_row = msg_row - 1;
        need_wait_return = FALSE;
        msg_didany = FALSE;
        msg_didout = FALSE;
index 1156fd64b284a6eede147b55d5823f95e21e40a2..b392cfdc55fb1545572b862d0a4823664ada5057 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1509,
 /**/
     1508,
 /**/