[PATCH 2/2] act: fix invalid cast in rtnl_act_msg_parse()

Thomas Haller thaller at redhat.com
Wed Apr 30 05:29:47 PDT 2014


This causes a memory corruption on the stack.

Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 lib/route/act.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/route/act.c b/lib/route/act.c
index 2157cf3..0e5d7d1 100644
--- a/lib/route/act.c
+++ b/lib/route/act.c
@@ -455,7 +455,7 @@ err_free:
 
 static int rtnl_act_msg_parse(struct nlmsghdr *n, struct rtnl_act **act)
 {
-	struct rtnl_tc *tc = TC_CAST(act);
+	struct rtnl_tc *tc = TC_CAST(*act);
 	struct nl_cache *link_cache;
 	struct nlattr *tb[TCAA_MAX + 1];
 	struct tcamsg *tm;
-- 
1.9.0




More information about the libnl mailing list