diff --git a/ChangeLog b/ChangeLog index bf528e6..51c91d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-07-04 Richard Frith-Macdonald + + * Protocol.m: ([-descriptionForClassMethod:]) + ([-descriptionForInstanceMethod:]) fix dereference of null pointer. + 2003-02-20 Alexandre Oliva * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to diff --git a/Protocol.m b/Protocol.m index 3c18a02..56f3370 100644 --- a/Protocol.m +++ b/Protocol.m @@ -80,10 +80,13 @@ struct objc_method_description_list { const char* name = sel_get_name (aSel); struct objc_method_description *result; - for (i = 0; i < instance_methods->count; i++) + if (instance_methods != 0) { - if (!strcmp ((char*)instance_methods->list[i].name, name)) - return &(instance_methods->list[i]); + for (i = 0; i < instance_methods->count; i++) + { + if (!strcmp ((char*)instance_methods->list[i].name, name)) + return &(instance_methods->list[i]); + } } for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) @@ -107,10 +110,13 @@ struct objc_method_description_list { const char* name = sel_get_name (aSel); struct objc_method_description *result; - for (i = 0; i < class_methods->count; i++) + if (class_methods != 0) { - if (!strcmp ((char*)class_methods->list[i].name, name)) - return &(class_methods->list[i]); + for (i = 0; i < class_methods->count; i++) + { + if (!strcmp ((char*)class_methods->list[i].name, name)) + return &(class_methods->list[i]); + } } for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)