# HG changeset patch # User Bram Moolenaar # Date 1601655315 -7200 # Node ID 542682b758dc61312710699aa9b2358db8582f2f # Parent 800d7d7274135c7650f5993fce058aff2add0cab patch 8.2.1785: compiler warning for strcp() out of bounds Commit: https://github.com/vim/vim/commit/3f974ff45e0ea4b85fea7d8768f005d8a2c7941e Author: Bram Moolenaar Date: Fri Oct 2 18:11:56 2020 +0200 patch 8.2.1785: compiler warning for strcp() out of bounds Problem: Compiler warning for strcp() out of bounds. (Christian Brabandt) Solution: use memmove() instead. diff --git a/src/dict.c b/src/dict.c --- a/src/dict.c +++ b/src/dict.c @@ -236,11 +236,12 @@ dictitem_alloc(char_u *key) dictitem_copy(dictitem_T *org) { dictitem_T *di; + size_t len = STRLEN(org->di_key); - di = alloc(offsetof(dictitem_T, di_key) + STRLEN(org->di_key) + 1); + di = alloc(offsetof(dictitem_T, di_key) + len + 1); if (di != NULL) { - STRCPY(di->di_key, org->di_key); + mch_memmove(di->di_key, org->di_key, len + 1); di->di_flags = DI_FLAGS_ALLOC; copy_tv(&org->di_tv, &di->di_tv); } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1785, +/**/ 1784, /**/ 1783,