[Fontconfig] fontconfig: Branch 'master'

Akira TAGOH akira at tagoh.org
Mon Mar 2 18:30:49 PST 2015


Doh. fixed. thanks!

On Tue, Mar 3, 2015 at 7:27 AM, Raimund Steger <rs at mytum.de> wrote:

> Hi,
>
> I think there is still a problem.
>
>
> On 02/23/15 07:23, Akira TAGOH wrote:
>
>> [...]
>>   src/fcstat.c |   80 ++++++++++++++++++++++++++++++
>> +++++++++++++++++++++++------
>> [...]
>> +int
>> +FcScandir (const char          *dirp,
>> +          struct dirent        ***namelist,
>> +          int (*filter) (const struct dirent *),
>> +          int (*compar) (const struct dirent **, const struct dirent **))
>>
>
> in the while loop in FcScandir, if n==lsize-1 -- it won't yet enter the
> 'if' branch:
>
>  [...]
>> +           if (n >= lsize)
>> +           {
>> +               lsize += 128;
>> +               dlp = (struct dirent **) realloc (dlist, sizeof (struct
>> dirent *) * lsize);
>>
>
> then this will effectively be dlist[lsize], thus unallocated:
>
>  [...]
>> +           }
>> +           dlist[n++] = p;
>> +           dlist[n] = NULL;
>>
>
> I think.
> maybe "if (n >= lsize-1)" would be better?
>
> Raimund
>
>
>
>
> --
> Worringer Str 31 Duesseldorf 40211 DE  home: <rs at mytum.de>
> +49-179-2981632 icq 16845346           work: <rs at interface-ag.de>
>



-- 
Akira TAGOH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20150303/8ebb2729/attachment.html>


More information about the Fontconfig mailing list