To: vim-dev@vim.org Subject: Patch 6.1.021 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.021 (depends on patch 6.1.009) Problem: Vim crashes when using a huge number for the minwid value in a statusline. (Robert M. Nowotniak) Solution: Check for an overflow that makes minwid negative. Files: src/buffer.c *** ../vim61.020/src/buffer.c Sun Apr 7 22:34:13 2002 --- src/buffer.c Mon Apr 8 19:58:50 2002 *************** *** 2972,2982 **** s++; l = -1; } ! while (*s && isdigit(*s)) { ! minwid *= 10; ! minwid += *s - '0'; ! s++; } if (*s == STL_HIGHLIGHT) { --- 2972,2982 ---- s++; l = -1; } ! if (isdigit(*s)) { ! minwid = (int)getdigits(&s); ! if (minwid < 0) /* overflow */ ! minwid = 0; } if (*s == STL_HIGHLIGHT) { *************** *** 2991,3005 **** { s++; if (isdigit(*s)) - maxwid = 0; - while (*s && isdigit(*s)) { ! maxwid *= 10; ! maxwid += *s - '0'; ! s++; } - if (maxwid <= 0) /* overflow */ - maxwid = 50; } minwid = (minwid > 50 ? 50 : minwid) * l; if (*s == '(') --- 2991,3001 ---- { s++; if (isdigit(*s)) { ! maxwid = (int)getdigits(&s); ! if (maxwid <= 0) /* overflow */ ! maxwid = 50; } } minwid = (minwid > 50 ? 50 : minwid) * l; if (*s == '(') *** ../vim61.020/src/version.c Sun Apr 21 15:46:47 2002 --- src/version.c Sun Apr 21 15:48:39 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 21, /**/ -- hundred-and-one symptoms of being an internet addict: 263. You have more e-mail addresses than shorts. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///