Permalink
Browse files

patch 8.0.0883: invalid memory access with nonsensical script

Problem:    Invalid memory access with nonsensical script.
Solution:   Check "dstlen" being positive. (Dominique Pelle)
  • Loading branch information...
brammool committed Aug 6, 2017
1 parent 4535654 commit 1c864093f93b0066de25d6c0ddf03a6bc6b1c870
Showing with 12 additions and 5 deletions.
  1. +10 −5 src/misc1.c
  2. +2 −0 src/version.c
View
@@ -4180,13 +4180,18 @@ expand_env_esc(
}
else if ((src[0] == ' ' || src[0] == ',') && !one)
at_start = TRUE;
*dst++ = *src++;
--dstlen;
if (dstlen > 0)
{
*dst++ = *src++;
--dstlen;
if (startstr != NULL && src - startstr_len >= srcp
&& STRNCMP(src - startstr_len, startstr, startstr_len) == 0)
at_start = TRUE;
if (startstr != NULL && src - startstr_len >= srcp
&& STRNCMP(src - startstr_len, startstr,
startstr_len) == 0)
at_start = TRUE;
}
}
}
*dst = NUL;
}
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
883,
/**/
882,
/**/

0 comments on commit 1c86409

Please sign in to comment.