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

Re: patch to fix overlapping strcpy(...) in vim-7.1.154

Expand Messages
  • Bram Moolenaar
    ... Thanks for the fix! -- I AM THANKFUL... ...for the mess to clean after a party because it means I have been surrounded by friends. /// Bram Moolenaar --
    Message 1 of 2 , Nov 10, 2007
    • 0 Attachment
      Dominique Pelle wrote:

      > Valgrind memory checker detects the following bug in vim-7.1.154:
      >
      > ==6518== Source and destination overlap in strcpy(0x4F8E442, 0x4F8E443)
      > ==6518== at 0x40245D2: strcpy (mc_replace_strmem.c:106)
      > ==6518== by 0x80AF714: eval_vars (ex_docmd.c:9394)
      > ==6518== by 0x80A7B6A: expand_filename (ex_docmd.c:4247)
      > ==6518== by 0x80A4F4B: do_one_cmd (ex_docmd.c:2557)
      > ==6518== by 0x80A293A: do_cmdline (ex_docmd.c:1099)
      > ==6518== by 0x808B6DA: ex_execute (eval.c:18592)
      > ==6518== by 0x80A50EA: do_one_cmd (ex_docmd.c:2621)
      > ==6518== by 0x80A293A: do_cmdline (ex_docmd.c:1099)
      > ==6518== by 0x808F04A: call_user_func (eval.c:20289)
      > ==6518== by 0x807B7BE: call_func (eval.c:7599)
      > ==6518== by 0x807B3E9: get_func_tv (eval.c:7446)
      > ==6518== by 0x8077A76: eval7 (eval.c:4697)
      >
      > Overlapping strings in strcpy(...) in ex_docmd.c:9394 has an
      > undefined behavior (may work or not).
      >
      > 9394 STRCPY(src - 1, src); /* remove backslash */
      >
      > I attach a patch for file ex_docmd.c with:
      >
      > - trivial fix for above bug (using mch_memmove() instead of STRCPY())
      > - fixed a few typos in comments
      > - fixed a typo in one translatable error message
      >
      > I'm using vim-7.1.154, on Linux, built without optimizations (-O0)
      > and configured with "./configure --with-features=huge".

      Thanks for the fix!

      --
      I AM THANKFUL...
      ...for the mess to clean after a party because it means I have
      been surrounded by friends.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.