From: Erik Faye-Lund Date: Tue, 23 Nov 2010 17:46:45 GMT Subject: Re: [RFC PATCH 2/6] msvc: opendir: allocate enough memory Message-ID: In-Reply-To: <20101123174215.GC12113@burratino> On Tue, Nov 23, 2010 at 6:42 PM, Jonathan Nieder wrote: > Erik Faye-Lund wrote: > >> --- a/compat/msvc.c >> +++ b/compat/msvc.c >> @@ -5,12 +5,11 @@ >> >>  DIR *opendir(const char *name) >>  { >> -     int len; >> +     int len = strlen(p->dd_name); >>       DIR *p; > > Does this work? > Whoops. It does work for me, but it shouldn't. I guess malloc is over-allocating, and git is only using short paths. Thanks for catching it.