Re: [RFC PATCH 2/6] msvc: opendir: allocate enough memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 23, 2010 at 6:42 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]