0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

updated for version 7.3.242

Problem:    Illegal memory access in after_pathsep().
Solution:   Check that the pointer is not at the start of the file name.
            (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2011-07-07 17:15:33 +02:00
parent 80ae7b2287
commit b5ce04dd28
2 changed files with 4 additions and 2 deletions

View File

@@ -3247,7 +3247,7 @@ get_real_state()
#if defined(FEAT_MBYTE) || defined(PROTO)
/*
* Return TRUE if "p" points to just after a path separator.
* Take care of multi-byte characters.
* Takes care of multi-byte characters.
* "b" must point to the start of the file name
*/
int
@@ -3255,7 +3255,7 @@ after_pathsep(b, p)
char_u *b;
char_u *p;
{
return vim_ispathsep(p[-1])
return p > b && vim_ispathsep(p[-1])
&& (!has_mbyte || (*mb_head_off)(b, p - 1) == 0);
}
#endif

View File

@@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
242,
/**/
241,
/**/