To: vim_dev@googlegroups.com Subject: Patch 8.0.0248 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0248 Problem: vim_strcat() cannot handle overlapping arguments. Solution: Use mch_memmove() instead of strcpy(). (Justin M Keyes, closes #1415) Files: src/misc2.c *** ../vim-8.0.0247/src/misc2.c 2017-01-26 22:51:51.997875762 +0100 --- src/misc2.c 2017-01-27 21:51:16.059159881 +0100 *************** *** 1719,1725 **** /* * Like strcat(), but make sure the result fits in "tosize" bytes and is ! * always NUL terminated. */ void vim_strcat(char_u *to, char_u *from, size_t tosize) --- 1719,1725 ---- /* * Like strcat(), but make sure the result fits in "tosize" bytes and is ! * always NUL terminated. "from" and "to" may overlap. */ void vim_strcat(char_u *to, char_u *from, size_t tosize) *************** *** 1733,1739 **** to[tosize - 1] = NUL; } else ! STRCPY(to + tolen, from); } /* --- 1733,1739 ---- to[tosize - 1] = NUL; } else ! mch_memmove(to + tolen, from, fromlen + 1); } /* *** ../vim-8.0.0247/src/version.c 2017-01-27 21:48:46.960162956 +0100 --- src/version.c 2017-01-27 21:52:25.134695318 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 248, /**/ -- ARTHUR: I command you as King of the Britons to stand aside! BLACK KNIGHT: I move for no man. The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///