From 1eb05e8a71f0930dbc7404390205a6ad72ee7f83 Mon Sep 17 00:00:00 2001 From: CaS Date: Fri, 4 Jul 2003 11:41:04 +0000 Subject: [PATCH] Small bugfix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/libobjc/trunk@17100 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Protocol.m | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) 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)