To: vim_dev@googlegroups.com Subject: Patch 8.2.1785 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1785 Problem: Compiler warning for strcp() out of bounds. (Christian Brabandt) Solution: use memmove() instead. Files: src/dict.c *** ../vim-8.2.1784/src/dict.c 2020-09-16 21:08:23.642361197 +0200 --- src/dict.c 2020-10-02 18:06:48.266996421 +0200 *************** *** 236,246 **** dictitem_copy(dictitem_T *org) { dictitem_T *di; ! di = alloc(offsetof(dictitem_T, di_key) + STRLEN(org->di_key) + 1); if (di != NULL) { ! STRCPY(di->di_key, org->di_key); di->di_flags = DI_FLAGS_ALLOC; copy_tv(&org->di_tv, &di->di_tv); } --- 236,247 ---- dictitem_copy(dictitem_T *org) { dictitem_T *di; + size_t len = STRLEN(org->di_key); ! di = alloc(offsetof(dictitem_T, di_key) + len + 1); if (di != NULL) { ! mch_memmove(di->di_key, org->di_key, len + 1); di->di_flags = DI_FLAGS_ALLOC; copy_tv(&org->di_tv, &di->di_tv); } *** ../vim-8.2.1784/src/version.c 2020-10-02 10:29:28.520196600 +0200 --- src/version.c 2020-10-02 18:06:45.883004433 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1785, /**/ -- How To Keep A Healthy Level Of Insanity: 9. As often as possible, skip rather than walk. /// 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 ///