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.0.149 < prev    next >
Encoding:
Internet Message Format  |  2002-01-21  |  2.9 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.149
  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.0.149
  11. Problem:    The pattern "\(.\{-}\)*" causes a hang.  When using a search
  12.         pattern that causes a stack overflow to be detected Vim could
  13.         still hang.
  14. Solution:   Correctly report "operand could be empty" when using "\{-}".
  15.         Check for "out_of_stack" inside loops to avoid a hang.
  16. Files:        src/regexp.c
  17.  
  18.  
  19. *** ../vim60.148/src/regexp.c    Mon Nov  5 09:00:25 2001
  20. --- src/regexp.c    Tue Jan 22 17:39:43 2002
  21. ***************
  22. *** 1305,1311 ****
  23.           reginsert_limits(BRACE_LIMITS, minval, maxval, ret);
  24.           ++num_complex_braces;
  25.           }
  26. !         if (minval > 0)
  27.           *flagp = (HASWIDTH | (flags & HASNL));
  28.           break;
  29.       }
  30. --- 1305,1311 ----
  31.           reginsert_limits(BRACE_LIMITS, minval, maxval, ret);
  32.           ++num_complex_braces;
  33.           }
  34. !         if (minval > 0 && maxval > 0)
  35.           *flagp = (HASWIDTH | (flags & HASNL));
  36.           break;
  37.       }
  38. ***************
  39. *** 3083,3089 ****
  40.   #endif
  41.       while (scan != NULL)
  42.       {
  43. !     if (got_int)
  44.           return FALSE;
  45.   #ifdef DEBUG
  46.       if (regnarrate)
  47. --- 3083,3089 ----
  48.   #endif
  49.       while (scan != NULL)
  50.       {
  51. !     if (got_int || out_of_stack)
  52.           return FALSE;
  53.   #ifdef DEBUG
  54.       if (regnarrate)
  55. ***************
  56. *** 3676,3682 ****
  57.                   reg_nextline();
  58.                   ++clnum;
  59.                   ccol = 0;
  60. !                 if (got_int)
  61.                       return FALSE;
  62.                   }
  63.   
  64. --- 3676,3682 ----
  65.                   reg_nextline();
  66.                   ++clnum;
  67.                   ccol = 0;
  68. !                 if (got_int || out_of_stack)
  69.                       return FALSE;
  70.                   }
  71.   
  72. ***************
  73. *** 3906,3912 ****
  74.                   regline = reg_getline(reglnum);
  75.                   reginput = regline + STRLEN(regline);
  76.                   fast_breakcheck();
  77. !                 if (got_int)
  78.                   return FALSE;
  79.               }
  80.               else
  81. --- 3906,3912 ----
  82.                   regline = reg_getline(reglnum);
  83.                   reginput = regline + STRLEN(regline);
  84.                   fast_breakcheck();
  85. !                 if (got_int || out_of_stack)
  86.                   return FALSE;
  87.               }
  88.               else
  89. ***************
  90. *** 3941,3947 ****
  91.                        || regrepeat(OPERAND(scan), 1L) == 0)
  92.                   break;
  93.               ++count;
  94. !             if (got_int)
  95.                   return FALSE;
  96.               }
  97.           }
  98. --- 3941,3947 ----
  99.                        || regrepeat(OPERAND(scan), 1L) == 0)
  100.                   break;
  101.               ++count;
  102. !             if (got_int || out_of_stack)
  103.                   return FALSE;
  104.               }
  105.           }
  106. *** ../vim60.148/src/version.c    Tue Jan 22 16:51:24 2002
  107. --- src/version.c    Tue Jan 22 17:35:49 2002
  108. ***************
  109. *** 608,609 ****
  110. --- 608,611 ----
  111.   {   /* Add new patch number below this line */
  112. + /**/
  113. +     149,
  114.   /**/
  115.  
  116. --  
  117. A fine is a tax for doing wrong.  A tax is a fine for doing well.
  118.  
  119.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  120. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  121.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  122.