Loading ...
Sorry, an error occurred while loading the content.

Patch 7.3.975

Expand Messages
  • Bram Moolenaar
    Patch 7.3.975 Problem: Crash in regexp parsing. Solution: Correctly compute the end of allocated memory. Files: src/regexp_nfa.c ... ***************
    Message 1 of 2 , May 20, 2013
    • 0 Attachment
      Patch 7.3.975
      Problem: Crash in regexp parsing.
      Solution: Correctly compute the end of allocated memory.
      Files: src/regexp_nfa.c


      *** ../vim-7.3.974/src/regexp_nfa.c 2013-05-19 22:31:13.000000000 +0200
      --- src/regexp_nfa.c 2013-05-20 13:43:37.000000000 +0200
      ***************
      *** 231,244 ****
      /* A reasonable estimation for size */
      nstate_max = (STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;

      ! /* Size for postfix representation of expr */
      postfix_size = sizeof(*post_start) * nstate_max;
      post_start = (int *)lalloc(postfix_size, TRUE);
      if (post_start == NULL)
      return FAIL;
      vim_memset(post_start, 0, postfix_size);
      post_ptr = post_start;
      ! post_end = post_start + postfix_size;
      nfa_has_zend = FALSE;

      regcomp_start(expr, re_flags);
      --- 231,249 ----
      /* A reasonable estimation for size */
      nstate_max = (STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;

      ! /* Some items blow up in size, such as [A-z]. Add more space for that.
      ! * TODO: some patterns may still fail. */
      ! // nstate_max += 1000;
      !
      ! /* Size for postfix representation of expr. */
      postfix_size = sizeof(*post_start) * nstate_max;
      +
      post_start = (int *)lalloc(postfix_size, TRUE);
      if (post_start == NULL)
      return FAIL;
      vim_memset(post_start, 0, postfix_size);
      post_ptr = post_start;
      ! post_end = post_start + nstate_max;
      nfa_has_zend = FALSE;

      regcomp_start(expr, re_flags);
      *** ../vim-7.3.974/src/version.c 2013-05-20 12:52:23.000000000 +0200
      --- src/version.c 2013-05-20 13:42:10.000000000 +0200
      ***************
      *** 730,731 ****
      --- 730,733 ----
      { /* Add new patch number below this line */
      + /**/
      + 975,
      /**/

      --
      My Go, this amn keyboar oesn't have a .

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... I had a crash when opening css files (not js or text files) with re set to 0 but this patch fixes it. :-) Best regards, Tony. -- I ve been teaching
      Message 2 of 2 , May 20, 2013
      • 0 Attachment
        On 20/05/13 13:44, Bram Moolenaar wrote:
        >
        > Patch 7.3.975
        > Problem: Crash in regexp parsing.
        > Solution: Correctly compute the end of allocated memory.
        > Files: src/regexp_nfa.c

        I had a crash when opening css files (not js or text files) with 're'
        set to 0 but this patch fixes it. :-)


        Best regards,
        Tony.
        --
        "I've been teaching myself to play the piano for about 5 years and now write
        most of my songs on it, mainly because I can never find any paper."
        Jeff Lynne, ELO's greatest hits


        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.