On Tue, Aug 3, 2010 at 8:07 AM, Nazri Ramliy <ayieh...@gmail.com> wrote:
> On Tue, Aug 3, 2010 at 7:51 AM, Ajit Thakkar <a...@unb.ca> wrote:
>> Revision:  7d1044b27e
>>
>> On WinXP, attempting find completion leads to a crash.
>>
>> gvim -N -u NONE a.tex
>> :find <Tab>
>> Vim crashes
>>
>> The same happens with
>> :find a<Tab>
>>
>> Ajit
>
> Thanks for testing it.
>
> I'll investigate the crash.

Attached is the fix on top of Revision:  7d1044b27e.

nazri.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
From 0e74ad37a897ea651ac3671b8d442ac4601ad754 Mon Sep 17 00:00:00 2001
From: nazri <ayieh...@gmail.com>
Date: Tue, 3 Aug 2010 08:25:43 +0800
Subject: [PATCH] Fix use of unallocated buffer for find completion on windows

---
 src/misc1.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/misc1.c b/src/misc1.c
index e564c5c..6e988fa 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9586,6 +9586,11 @@ expand_in_path(gap, pattern, flags)
 	return 0;
     mch_dirname(curdir, MAXPATHL);
 
+# ifdef WIN3264
+    if ((file_pattern = alloc((int)(MAXPATHL))) == NULL)
+	return 0;
+# endif
+
     expand_path_option(curdir, &path_ga);
     vim_free(curdir);
     path_list = (char_u **)(path_ga.ga_data);
@@ -9599,6 +9604,8 @@ expand_in_path(gap, pattern, flags)
 	STRCAT(file_pattern, pattern);
 	mch_expandpath(gap, file_pattern, EW_DIR|EW_ADDSLASH|EW_FILE);
     }
+
+    vim_free(file_pattern);
 # else
     for (i = 0; i < path_ga.ga_len; i++)
     {
-- 
1.7.2.1.6.g61bf12

Raspunde prin e-mail lui