changeset 5110:dafd77a15d44 v7.3.1298

updated for version 7.3.1298 Problem: Crash. Solution: Use STRCPY() instead of STRCAT() and allocate one more byte.
author Bram Moolenaar <bram@vim.org>
date Wed, 03 Jul 2013 17:51:17 +0200
parents cdf30ced9b5c
children a539e15ad57c
files src/misc2.c src/version.c
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -4680,11 +4680,11 @@ vim_findfile_init(path, filename, stopdi
     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);
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1298,
+/**/
     1297,
 /**/
     1296,