# HG changeset patch # User Sebastien Decugis # Date 1359812589 -3600 # Node ID 9bd18fa4e6016d40b3915cf104840f6b619d2e7b # Parent b6b631c268f38dc617a5c62212d93f4692944c86 Fix macro to avoid infinite loop in some situations diff -r b6b631c268f3 -r 9bd18fa4e601 libfdproto/messages.c --- a/libfdproto/messages.c Fri Feb 01 17:05:26 2013 +0100 +++ b/libfdproto/messages.c Sat Feb 02 14:43:09 2013 +0100 @@ -105,7 +105,7 @@ /* Macro to cast a msg_avp_t */ #define _A(_x) ((struct avp *)(_x)) /* Check the type and eyecatcher */ -#define CHECK_AVP(_x) ((_C(_x)->type == MSG_AVP) && (_A(_x)->avp_eyec == MSG_AVP_EYEC)) +#define CHECK_AVP(_x) ((_x) && (_C(_x)->type == MSG_AVP) && (_A(_x)->avp_eyec == MSG_AVP_EYEC)) /* The following structure represents an instance of a message (command and children AVPs). */ struct msg {