changeset 915:9bd18fa4e601

Fix macro to avoid infinite loop in some situations
author Sebastien Decugis <sdecugis@freediameter.net>
date Sat, 02 Feb 2013 14:43:09 +0100
parents b6b631c268f3
children 058e95c3a336
files libfdproto/messages.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 {
"Welcome to our mercurial repository"