* [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
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.