Mercurial > vim
changeset 2939:3d96ddbeb3b0 v7.3.242
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 07 Jul 2011 17:15:33 +0200 |
parents | a760fc312712 |
children | 8d85207cec37 |
files | src/misc2.c src/version.c |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/misc2.c +++ b/src/misc2.c @@ -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