strlen().
+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
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;
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;