[Fontconfig] fontconfig: Branch 'master'

Raimund Steger rs at mytum.de
Wed Feb 25 15:17:26 PST 2015


Hi,

there is still a problem. d_name gets cut off, hence stat won't find the 
file.

I believe it's this:

> [...]
>   	    p = (struct dirent *) malloc (sizeof (struct dirent));
>   	    memcpy (p, dent, sizeof (struct dirent));

According to [1], d_name is indeed variable size though might be defined 
to size 1 in headers, so copying sizeof(struct dirent) with memcpy will 
likely not work.

It seems most platforms have a (non-standard) d_reclen field, but the 
portable way would probably be to add strlen(d_name) before any copying 
is done.

-Raimund



[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html




-- 
Worringer Str 31 Duesseldorf 40211 DE  home: <rs at mytum.de>
+49-179-2981632 icq 16845346           work: <rs at interface-ag.de>


More information about the Fontconfig mailing list