# HG changeset patch # User Sebastien Decugis # Date 1295940867 -32400 # Node ID 289632905e19f2207e97d111bf80aa10fe7e1b80 # Parent b1d7d7cad7331c7021e85d38f9f315dcf34e83a4 Added new sanity check diff -r b1d7d7cad733 -r 289632905e19 libfdproto/messages.c --- a/libfdproto/messages.c Tue Jan 25 16:20:37 2011 +0900 +++ b/libfdproto/messages.c Tue Jan 25 16:34:27 2011 +0900 @@ -134,7 +134,7 @@ /* Macro to cast a msg_avp_t */ #define _M(_x) ((struct msg *)(_x)) /* Check the type and eyecatcher */ -#define CHECK_MSG(_x) ((_C(_x)->type == MSG_MSG) && (_M(_x)->msg_eyec == MSG_MSG_EYEC)) +#define CHECK_MSG(_x) ((_x) && (_C(_x)->type == MSG_MSG) && (_M(_x)->msg_eyec == MSG_MSG_EYEC)) #define VALIDATE_OBJ(_x) ( (CHECK_MSG(_x)) || (CHECK_AVP(_x)) )