1From 01ea9a6224b77292e8506bf179729aeeaac30398 Mon Sep 17 00:00:00 2001 2From: Jan Slomski <jan.slomski@westermo.se> 3Date: Wed, 21 Mar 2018 10:23:57 +0100 4Subject: [PATCH] route/link: Check for null pointer in macvlan 5 6In cases where link->l_info is not set, a null-ptr-exception 7will be invoked. 8 9https://github.com/thom311/libnl/pull/238 10 11Conflict:NA 12Reference:https://github.com/thom311/libnl/commit/01ea9a6224b77292e8506bf179729aeeaac30398 13Reference:https://github.com/thom311/libnl/commit/9cc38dcaeb55b5729c6c97b47884cebbda72b693 14--- 15 lib/route/link/macvlan.c | 2 ++ 16 1 file changed, 2 insertions(+) 17 18diff --git a/lib/route/link/macvlan.c b/lib/route/link/macvlan.c 19index a23fe6d8..3ccebf45 100644 20--- a/lib/route/link/macvlan.c 21+++ b/lib/route/link/macvlan.c 22@@ -149,6 +149,8 @@ static void macvlan_free(struct rtnl_link *link) 23 uint32_t i; 24 25 mvi = link->l_info; 26+ if (!mvi) 27+ return; 28 29 for (i = 0; i < mvi->mvi_maccount; i++) 30 nl_addr_put(mvi->mvi_macaddr[i]); 31