All of lore.kernel.org
 help / color / mirror / Atom feed
* [LIBNFNETLINK 1/3] Add NLMSG_OK checking to nfnl_get_msg_next
@ 2006-02-12 21:39 Pablo Neira Ayuso
  2006-02-13 11:34 ` Harald Welte
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2006-02-12 21:39 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Harald Welte, Patrick McHardy

[-- Attachment #1: Type: text/plain, Size: 89 bytes --]

nfnl_get_msg_next must check is the message is OK after NLMSG_NEXT is
called.

-- 
Pablo

[-- Attachment #2: 01.patch --]
[-- Type: text/plain, Size: 690 bytes --]

[LIBNFNETLINK] Add NLMSG_OK checking to nfnl_get_msg_next

nfnl_get_msg_next must check is the message is OK after NLMSG_NEXT
is called.

Index: libnfnetlink/src/libnfnetlink.c
===================================================================
--- libnfnetlink.orig/src/libnfnetlink.c	2006-02-12 19:24:26.000000000 +0100
+++ libnfnetlink/src/libnfnetlink.c	2006-02-12 19:28:19.000000000 +0100
@@ -861,6 +861,11 @@ struct nlmsghdr *nfnl_get_msg_next(struc
 	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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LIBNFNETLINK 1/3] Add NLMSG_OK checking to nfnl_get_msg_next
  2006-02-12 21:39 [LIBNFNETLINK 1/3] Add NLMSG_OK checking to nfnl_get_msg_next Pablo Neira Ayuso
@ 2006-02-13 11:34 ` Harald Welte
  0 siblings, 0 replies; 2+ messages in thread
From: Harald Welte @ 2006-02-13 11:34 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Development Mailinglist, Patrick McHardy

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

On Sun, Feb 12, 2006 at 10:39:21PM +0100, Pablo Neira Ayuso wrote:
> nfnl_get_msg_next must check is the message is OK after NLMSG_NEXT is
> called.

thanks, applied.

-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-13 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-12 21:39 [LIBNFNETLINK 1/3] Add NLMSG_OK checking to nfnl_get_msg_next Pablo Neira Ayuso
2006-02-13 11:34 ` Harald Welte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.