0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.3.1298

Problem:    Crash.
Solution:   Use STRCPY() instead of STRCAT() and allocate one more byte.
This commit is contained in:
Bram Moolenaar
2013-07-03 17:51:17 +02:00
parent f4c5fcb3ad
commit 0f5a5ed8bb
2 changed files with 5 additions and 3 deletions

View File

@@ -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);