Fix two unchecked pointer dereferences in the libobjc2 compatibility

code, which could cause crashes when attempting to invoke a selector
which is not implemented by the target.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31384 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-09-20 18:13:48 +00:00
parent a26b510c01
commit 2a5d060cfa
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2010-09-20 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/ObjectiveC2/runtime.c (method_getImplementation,
method_getName): Fix unchecked pointer dereferences, which could
cause crashes when attempting to invoke a selector which is not
implemented by the target.
2010-09-19 Quentin Mathe <quentin.mathe@gmail.com>
* Headers/Additions/GNUstepBase/preface.h.in:

View file

@ -675,13 +675,13 @@ method_getArgumentType(Method method,
IMP
method_getImplementation(Method method)
{
return (IMP) method->method_imp;
return method ? (IMP) method->method_imp : (IMP) 0;
}
SEL
method_getName(Method method)
{
return method->method_name;
return method ? method->method_name : (SEL) 0;
}
unsigned