comparison src/option.c @ 5070:cf52d2a8c05c v7.3.1278

updated for version 7.3.1278 Problem: When someone sets the screen size to a huge value with "stty" Vim runs out of memory before reducing the size. Solution: Limit Rows and Columns in more places.
author Bram Moolenaar <bram@vim.org>
date Sun, 30 Jun 2013 17:51:51 +0200
parents a02575cd564a
children 11d0c6df1d7b
comparison
equal deleted inserted replaced
5069:44f2eb39f49e 5070:cf52d2a8c05c
8526 _("E594: Need at least %d columns"), MIN_COLUMNS); 8526 _("E594: Need at least %d columns"), MIN_COLUMNS);
8527 errmsg = errbuf; 8527 errmsg = errbuf;
8528 } 8528 }
8529 Columns = MIN_COLUMNS; 8529 Columns = MIN_COLUMNS;
8530 } 8530 }
8531 /* Limit the values to avoid an overflow in Rows * Columns. */ 8531 limit_screen_size();
8532 if (Columns > 10000)
8533 Columns = 10000;
8534 if (Rows > 1000)
8535 Rows = 1000;
8536 8532
8537 #ifdef DJGPP 8533 #ifdef DJGPP
8538 /* avoid a crash by checking for a too large value of 'columns' */ 8534 /* avoid a crash by checking for a too large value of 'columns' */
8539 if (old_Columns != Columns && full_screen && term_console) 8535 if (old_Columns != Columns && full_screen && term_console)
8540 mch_check_columns(); 8536 mch_check_columns();