forked from aniani/vim
patch 8.0.0883: invalid memory access with nonsensical script
Problem: Invalid memory access with nonsensical script. Solution: Check "dstlen" being positive. (Dominique Pelle)
This commit is contained in:
@@ -4180,14 +4180,19 @@ expand_env_esc(
|
|||||||
}
|
}
|
||||||
else if ((src[0] == ' ' || src[0] == ',') && !one)
|
else if ((src[0] == ' ' || src[0] == ',') && !one)
|
||||||
at_start = TRUE;
|
at_start = TRUE;
|
||||||
|
if (dstlen > 0)
|
||||||
|
{
|
||||||
*dst++ = *src++;
|
*dst++ = *src++;
|
||||||
--dstlen;
|
--dstlen;
|
||||||
|
|
||||||
if (startstr != NULL && src - startstr_len >= srcp
|
if (startstr != NULL && src - startstr_len >= srcp
|
||||||
&& STRNCMP(src - startstr_len, startstr, startstr_len) == 0)
|
&& STRNCMP(src - startstr_len, startstr,
|
||||||
|
startstr_len) == 0)
|
||||||
at_start = TRUE;
|
at_start = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
*dst = NUL;
|
*dst = NUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -769,6 +769,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 */
|
||||||
|
/**/
|
||||||
|
883,
|
||||||
/**/
|
/**/
|
||||||
882,
|
882,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user