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

[patch] VIM 6.2e SEGV

Expand Messages
  • Nam SungHyun
    Hello, If there already exists swap file, gvim killed by SEGV. Because I use UTF-8, mb_ptr2len_check is utfc_ptr2len_check. And it returns 0 because *p is
    Message 1 of 2 , May 20, 2003
      Hello,

      If there already exists swap file, gvim killed by SEGV.

      Because I use UTF-8, mb_ptr2len_check is utfc_ptr2len_check.
      And it returns 0 because '*p' is NUL. So, no further spliting occurs.
      Now, ync[1] and ync[2] in 'dialog_add_buttons()' is illegal.

      Regards,
      namsh

      diff -u -r1.45 gui_gtk.c
      --- gui_gtk.c 6 May 2003 17:02:22 -0000 1.45
      +++ gui_gtk.c 21 May 2003 03:00:29 -0000
      @@ -1897,6 +1897,10 @@
      {
      *p = NUL;
      array[count++] = (char *)p + 1;
      +#ifdef FEAT_MBYTE
      + if (has_mbyte)
      + p++;
      +#endif
      }
      else if (*p == DLG_HOTKEY_CHAR)
      *p = '_';
    • Bram Moolenaar
      ... I am very glad you tracked down this problem. So far I could not reproduce this crash, but after setting encoding to utf-8 I can. Another solution is
      Message 2 of 2 , May 21, 2003
        Nam SungHyun wrote:

        > If there already exists swap file, gvim killed by SEGV.
        >
        > Because I use UTF-8, mb_ptr2len_check is utfc_ptr2len_check.
        > And it returns 0 because '*p' is NUL. So, no further spliting occurs.
        > Now, ync[1] and ync[2] in 'dialog_add_buttons()' is illegal.

        I am very glad you tracked down this problem. So far I could not
        reproduce this crash, but after setting 'encoding' to "utf-8" I can.

        Another solution is to insert an "else":

        *** ../vim-6.2e/src/gui_gtk.c Mon May 5 20:15:18 2003
        --- src/gui_gtk.c Wed May 21 10:18:20 2003
        ***************
        *** 1901,1907 ****
        else if (*p == DLG_HOTKEY_CHAR)
        *p = '_';
        #ifdef FEAT_MBYTE
        ! if (has_mbyte)
        p += (*mb_ptr2len_check)(p) - 1;
        #endif
        }
        --- 1901,1907 ----
        else if (*p == DLG_HOTKEY_CHAR)
        *p = '_';
        #ifdef FEAT_MBYTE
        ! else if (has_mbyte)
        p += (*mb_ptr2len_check)(p) - 1;
        #endif
        }

        --
        BEDEVERE: Oooooh!
        LAUNCELOT: No "Aaaaarrrrrrggghhh ... " at the back of the throat.
        BEDEVERE: No! "Oooooh!" in surprise and alarm!
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      Your message has been successfully submitted and would be delivered to recipients shortly.