Skip to content

Commit

Permalink
Fix buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
k-takata committed May 23, 2019
1 parent 2931ea7 commit 4f927cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/misc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2711,7 +2711,7 @@ fullpathcmp(
if (expandenv)
expand_env(s1, exp1, MAXPATHL);
else
vim_strncpy(exp1, s1, MAXPATHL);
vim_strncpy(exp1, s1, MAXPATHL - 1);
r1 = mch_stat((char *)exp1, &st1);
r2 = mch_stat((char *)s2, &st2);
if (r1 != 0 && r2 != 0)
Expand Down Expand Up @@ -2749,7 +2749,7 @@ fullpathcmp(
if (expandenv)
expand_env(s1, exp1, MAXPATHL);
else
vim_strncpy(exp1, s1, MAXPATHL);
vim_strncpy(exp1, s1, MAXPATHL - 1);
r1 = vim_FullName(exp1, full1, MAXPATHL, FALSE);
r2 = vim_FullName(s2, full2, MAXPATHL, FALSE);

Expand Down

0 comments on commit 4f927cb

Please sign in to comment.