From 506ccbd589918a8d0f94d01433dcf5b60228066f Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 13 Apr 2016 18:30:45 +0200 Subject: [PATCH] Correct a security check in PyHurricane.h. * Bug: In Hurricane, in PyHurricane.h, the macro GENERIC_METHOD_HEAD was not checking at all that the underlying Hurricane object was not NULL. This may have lead to core-dumps. --- hurricane/src/isobar/hurricane/isobar/PyHurricane.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h index a5c53a57..90c71963 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h +++ b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h @@ -194,13 +194,13 @@ extern "C" { #define GENERIC_METHOD_HEAD(SELF_TYPE,SELF_OBJECT,function) \ if ( self->ACCESS_OBJECT == NULL ) { \ - PyErr_SetString ( ProxyError, "Attempt to call " function " on an unbound hurricane object" ); \ - return ( NULL ); \ + PyErr_SetString( ProxyError, "Attempt to call " function " on an unbound hurricane object" ); \ + return NULL; \ } \ SELF_TYPE* SELF_OBJECT = dynamic_cast(self->ACCESS_OBJECT);\ - if ( self->ACCESS_OBJECT == NULL ) { \ - PyErr_SetString ( ProxyError, "Invalid dynamic_cast while calling " function "" ); \ - return ( NULL ); \ + if ( SELF_OBJECT == NULL ) { \ + PyErr_SetString( ProxyError, "Invalid dynamic_cast<> while calling " function "" ); \ + return NULL; \ }