From 3c8407c41d80cc5e1f6c95f0204851a2fc6d2a71 Mon Sep 17 00:00:00 2001 From: theraven Date: Mon, 21 Nov 2011 23:19:06 +0000 Subject: [PATCH] Fix incorrect malloc size. --- properties.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/properties.m b/properties.m index faea56f..fe4344d 100644 --- a/properties.m +++ b/properties.m @@ -464,7 +464,8 @@ BOOL class_addProperty(Class cls, // If there is a name mismatch, the attributes are invalid. if ((p.name != 0) && (strcmp(name, p.name) != 0)) { return NO; } - struct objc_property_list *l = calloc(1, sizeof(struct objc_property_list)); + struct objc_property_list *l = calloc(1, sizeof(struct objc_property_list) + + sizeof(struct objc_property)); l->count = 0; memcpy(&l->properties, &p, sizeof(struct objc_property)); LOCK_RUNTIME_FOR_SCOPE();