Commit 23787a8f authored by Patrick Lam's avatar Patrick Lam
Browse files

Add padding to make valgrind and glibc not hate each other when calling

    strlen().
parent edffd3b9
2005-10-06 Patrick Lam <plam@mit.edu>
* src/fcname.c (FcObjectToPtr):
* src/fcpat.c (FcStrStaticName):
Add padding to make valgrind and glibc not hate each other
when calling strlen().
2005-10-05 Simos Xenitellis <simos74@gmx.net>
reviewed by: plam & keithp
......
......@@ -263,8 +263,9 @@ FcObjectToPtr (const char * name)
if (b->hash == hash && !strcmp (name, (char *) (b + 1)))
return b->id;
size = sizeof (struct objectBucket) + strlen (name) + 1;
b = malloc (size);
FcMemAlloc (FC_MEM_STATICSTR, size);
/* workaround glibc bug which reads strlen in groups of 4 */
b = malloc (size + sizeof (int));
FcMemAlloc (FC_MEM_STATICSTR, size + sizeof(int));
if (!b)
return 0;
b->next = 0;
......
......@@ -1298,8 +1298,9 @@ FcStrStaticName (const FcChar8 *name)
if (b->hash == hash && !strcmp ((char *)name, (char *) (b + 1)))
return (FcChar8 *) (b + 1);
size = sizeof (struct objectBucket) + strlen ((char *)name) + 1;
b = malloc (size);
FcMemAlloc (FC_MEM_STATICSTR, size);
b = malloc (size + sizeof (int));
/* workaround glibc bug which reads strlen in groups of 4 */
FcMemAlloc (FC_MEM_STATICSTR, size + sizeof (int));
if (!b)
return NULL;
b->next = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment