summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-07-07 17:15:33 +0200
committerBram Moolenaar <Bram@vim.org>2011-07-07 17:15:33 +0200
commitb5ce04dd281d2923693255a1f565d2170c2ca504 (patch)
tree151dae5917713d4243f75298c83abf1387ee641b /src/misc2.c
parent80ae7b2287d712069243d8ebe2e4a39bd79737a4 (diff)
downloadvim-b5ce04dd281d2923693255a1f565d2170c2ca504.zip
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)
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/misc2.c b/src/misc2.c
index b7e7d01ea..dfb1fc487 100644
--- 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