summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-07-03 17:51:17 +0200
committerBram Moolenaar <Bram@vim.org>2013-07-03 17:51:17 +0200
commit0f5a5ed8bb3c014ef9de0480852a3e5737c33fc6 (patch)
treed268f8ab82ae455ad78eb1a23b411775daa66103 /src/misc2.c
parentf4c5fcb3ad0b98d6827d5f95e5c66cdd54e66a02 (diff)
downloadvim-git-0f5a5ed8bb3c014ef9de0480852a3e5737c33fc6.tar.gz
updated for version 7.3.1298v7.3.1298
Problem: Crash. Solution: Use STRCPY() instead of STRCAT() and allocate one more byte.
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/misc2.c b/src/misc2.c
index c63344f0d..bc1580888 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -4680,11 +4680,11 @@ vim_findfile_init(path, filename, stopdirs, level, free_visited, find_what,
STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
add_pathsep(ff_expand_buffer);
{
- char_u *buf = alloc(STRLEN(ff_expand_buffer)
- + STRLEN(search_ctx->ffsc_fix_path));
+ int eb_len = STRLEN(ff_expand_buffer);
+ char_u *buf = alloc(eb_len + STRLEN(search_ctx->ffsc_fix_path) + 1);
STRCPY(buf, ff_expand_buffer);
- STRCAT(buf, search_ctx->ffsc_fix_path);
+ STRCPY(buf + eb_len, search_ctx->ffsc_fix_path);
if (mch_isdir(buf))
{
STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);