Mercurial > hg > freeDiameter
diff libfdproto/messages.c @ 704:289632905e19
Added new sanity check
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 25 Jan 2011 16:34:27 +0900 |
parents | a29e4201d511 |
children | 4ffbc9f1e922 |
line wrap: on
line diff
--- 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)) )