[PATCH 5/7] ip6: Perform sanity check before processing prefix messages
- From: Thomas Graf <tgraf redhat com>
- To: dcbw redhat com
- Cc: Thomas Graf <tgraf redhat com>, networkmanager-list gnome org
- Subject: [PATCH 5/7] ip6: Perform sanity check before processing prefix messages
- Date: Fri, 9 Sep 2011 11:39:07 +0200
Verifies that the provided message consists of at least the prefix header.
---
src/ip6-manager/nm-ip6-manager.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c
index 721d43b..c734139 100644
--- a/src/ip6-manager/nm-ip6-manager.c
+++ b/src/ip6-manager/nm-ip6-manager.c
@@ -624,6 +624,11 @@ process_prefix (NMIP6Manager *manager, struct nl_msg *msg)
nm_log_dbg (LOGD_IP6, "processing netlink new prefix message");
+ if (!nlmsg_valid_hdr (nlmsg_hdr (msg), sizeof(*pmsg))) {
+ nm_log_dbg (LOGD_IP6, "ignoring invalid prefix message");
+ return NULL;
+ }
+
pmsg = (struct prefixmsg *) NLMSG_DATA (nlmsg_hdr (msg));
device = nm_ip6_manager_get_device (manager, pmsg->prefix_ifindex);
--
1.7.6
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]