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

Re: [vimdev] Patch 5.7.027

Expand Messages
  • Dr. Charles E. Campbell
    ... I note that a very similar construct is still present in 6.0z s ... keep_msg = msg_trunc_attr(IObuff, FALSE, 0); keep_msg_attr = 0; if (read_stdin ||
    Message 1 of 1 , Mar 30, 2001
    • 0 Attachment
      Thus saith Bram Moolenaar:
      > Patch 5.7.027
      > Problem: Starting to edit a file can cause a crash. For example when in
      > Insert mode, using CTRL-O :help abbr<Tab> to scroll the screen and
      > then <CR>, which edits a help file. (Robert Bogomip)
      > Solution: Check if keep_msg is NULL before copying it.
      > Files: src/fileio.c
      ---------------------------------------------------------------------

      I note that a very similar construct is still present in 6.0z's
      <fileio.c> near line 1782:

      ---------------------------------------------------------------------
      keep_msg = msg_trunc_attr(IObuff, FALSE, 0);
      keep_msg_attr = 0;
      if (read_stdin || read_buffer || restart_edit != 0)
      {
      /* When reading from stdin, the screen will be cleared next;
      * keep the message to repeat it later.
      * When restart_edit is set, keep the message to show it after
      * redrawing (otherwise there will be a delay before
      * redrawing).
      * Copy the message (truncated) to msg_buf, because IObuff
      * could be overwritten any time. */
      STRNCPY(msg_buf, keep_msg, MSG_BUF_LEN);
      ^^^^^^^^
      note that a strncpy will be done, but
      keep_msg could be null (msg_trunc_attr()
      can return NULL).
      ---------------------------------------------------------------------

      I don't know how to get vim to exercise this possible crash, because the
      directions that apparently cause 5.7 to crash don't do so to 6.0z.

      Regards,
      C Campbell

      --
      Charles E Campbell, Jr, PhD _ __ __
      Goddard Space Flight Center / /_/\_\_/ /
      cec@... /_/ \/_//_/
      PGP public key: http://www.erols.com/astronaut/pgp.html
    Your message has been successfully submitted and would be delivered to recipients shortly.