[lxc-devel] [PATCH 1/4] coverity: don't reference beyond structure

Dwight Engen dwight.engen at oracle.com
Fri May 3 16:03:45 UTC 2013


Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
---
 src/lxc/genl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/genl.c b/src/lxc/genl.c
index 873b084..8fcb6b7 100644
--- a/src/lxc/genl.c
+++ b/src/lxc/genl.c
@@ -55,7 +55,7 @@ static int genetlink_resolve_family(const char *family)
 	request->nlmsghdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
         request->nlmsghdr.nlmsg_type = GENL_ID_CTRL;
 
-	genlmsghdr = NLMSG_DATA(&request->nlmsghdr);
+	genlmsghdr = &request->genlmsghdr;
         genlmsghdr->cmd = CTRL_CMD_GETFAMILY;
 
 	ret = netlink_open(&handler, NETLINK_GENERIC);
@@ -72,7 +72,7 @@ static int genetlink_resolve_family(const char *family)
 	if (ret < 0)
 		goto out_close;
 
-	genlmsghdr = NLMSG_DATA(&reply->nlmsghdr);
+	genlmsghdr = &reply->genlmsghdr;
 	len = reply->nlmsghdr.nlmsg_len;
 
 	ret = -ENOMSG;
-- 
1.8.1.4





More information about the lxc-devel mailing list