home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.021 < prev    next >
Encoding:
Internet Message Format  |  2002-04-20  |  2.1 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.021
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.021 (depends on patch 6.1.009)
  11. Problem:    Vim crashes when using a huge number for the minwid value in a
  12.         statusline. (Robert M. Nowotniak)
  13. Solution:   Check for an overflow that makes minwid negative.
  14. Files:        src/buffer.c
  15.  
  16.  
  17. *** ../vim61.020/src/buffer.c    Sun Apr  7 22:34:13 2002
  18. --- src/buffer.c    Mon Apr  8 19:58:50 2002
  19. ***************
  20. *** 2972,2982 ****
  21.           s++;
  22.           l = -1;
  23.       }
  24. !     while (*s && isdigit(*s))
  25.       {
  26. !         minwid *= 10;
  27. !         minwid += *s - '0';
  28. !         s++;
  29.       }
  30.       if (*s == STL_HIGHLIGHT)
  31.       {
  32. --- 2972,2982 ----
  33.           s++;
  34.           l = -1;
  35.       }
  36. !     if (isdigit(*s))
  37.       {
  38. !         minwid = (int)getdigits(&s);
  39. !         if (minwid < 0)    /* overflow */
  40. !         minwid = 0;
  41.       }
  42.       if (*s == STL_HIGHLIGHT)
  43.       {
  44. ***************
  45. *** 2991,3005 ****
  46.       {
  47.           s++;
  48.           if (isdigit(*s))
  49. -         maxwid = 0;
  50. -         while (*s && isdigit(*s))
  51.           {
  52. !         maxwid *= 10;
  53. !         maxwid += *s - '0';
  54. !         s++;
  55.           }
  56. -         if (maxwid <= 0)    /* overflow */
  57. -         maxwid = 50;
  58.       }
  59.       minwid = (minwid > 50 ? 50 : minwid) * l;
  60.       if (*s == '(')
  61. --- 2991,3001 ----
  62.       {
  63.           s++;
  64.           if (isdigit(*s))
  65.           {
  66. !         maxwid = (int)getdigits(&s);
  67. !         if (maxwid <= 0)    /* overflow */
  68. !             maxwid = 50;
  69.           }
  70.       }
  71.       minwid = (minwid > 50 ? 50 : minwid) * l;
  72.       if (*s == '(')
  73. *** ../vim61.020/src/version.c    Sun Apr 21 15:46:47 2002
  74. --- src/version.c    Sun Apr 21 15:48:39 2002
  75. ***************
  76. *** 608,609 ****
  77. --- 608,611 ----
  78.   {   /* Add new patch number below this line */
  79. + /**/
  80. +     21,
  81.   /**/
  82.  
  83. -- 
  84. hundred-and-one symptoms of being an internet addict:
  85. 263. You have more e-mail addresses than shorts.
  86.  
  87.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  88. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  89. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  90.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  91.