forked from aniani/vim
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.
This commit is contained in:
@@ -236,11 +236,12 @@ dictitem_alloc(char_u *key)
|
|||||||
dictitem_copy(dictitem_T *org)
|
dictitem_copy(dictitem_T *org)
|
||||||
{
|
{
|
||||||
dictitem_T *di;
|
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)
|
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;
|
di->di_flags = DI_FLAGS_ALLOC;
|
||||||
copy_tv(&org->di_tv, &di->di_tv);
|
copy_tv(&org->di_tv, &di->di_tv);
|
||||||
}
|
}
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1785,
|
||||||
/**/
|
/**/
|
||||||
1784,
|
1784,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user