[netfilter-cvslog] r6467 - trunk/libnfnetlink/src

laforge at netfilter.org laforge at netfilter.org
Mon Feb 13 12:44:59 CET 2006


Author: laforge at netfilter.org
Date: 2006-02-13 12:44:59 +0100 (Mon, 13 Feb 2006)
New Revision: 6467

Modified:
   trunk/libnfnetlink/src/libnfnetlink.c
Log:
nfnl_get_msg_next must check is the message is OK after NLMSG_NEXT                                        
is called.  (Pablo Neira)


Modified: trunk/libnfnetlink/src/libnfnetlink.c
===================================================================
--- trunk/libnfnetlink/src/libnfnetlink.c	2006-02-11 09:50:11 UTC (rev 6466)
+++ trunk/libnfnetlink/src/libnfnetlink.c	2006-02-13 11:44:59 UTC (rev 6467)
@@ -861,6 +861,11 @@
 	remain_len = (len - ((unsigned char *)h->last_nlhdr - buf));
 	nlh = NLMSG_NEXT(h->last_nlhdr, remain_len);
 
+	if (!NLMSG_OK(nlh, remain_len)) {
+		h->last_nlhdr = NULL;
+		return NULL;
+	}
+
 	h->last_nlhdr = nlh;
 
 	return nlh;




More information about the netfilter-cvslog mailing list