From 0eeff38f1b7b32bb4ea01c3f35ee199c3466edf7 Mon Sep 17 00:00:00 2001 From: theraven Date: Thu, 17 May 2012 14:49:28 +0000 Subject: [PATCH] Fix potential null pointer dereference. Reported by: Riccardo Mottola --- protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol.c b/protocol.c index 5b94e54..e9b80ce 100644 --- a/protocol.c +++ b/protocol.c @@ -59,8 +59,8 @@ static int isEmptyProtocol(struct objc_protocol2 *aProto) struct objc_protocol2 *p2 = (struct objc_protocol2*)aProto; isEmpty &= (p2->optional_instance_methods->count == 0); isEmpty &= (p2->optional_class_methods->count == 0); - isEmpty &= (p2->properties->count == 0); - isEmpty &= (p2->optional_properties->count == 0); + isEmpty &= (p2->properties == 0) || (p2->properties->count == 0); + isEmpty &= (p2->optional_properties == 0) || (p2->optional_properties->count == 0); } return isEmpty; }