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