加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-route-link-Check-for-null-pointer-in-macvlan.patch 974 Bytes
一键复制 编辑 原始数据 按行查看 历史
Apricity 提交于 2021-03-10 10:58 . sync patches from the upstream community
From 01ea9a6224b77292e8506bf179729aeeaac30398 Mon Sep 17 00:00:00 2001
From: Jan Slomski <jan.slomski@westermo.se>
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]);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化