加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-8021qaz-squelch-initialization-errors.patch 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
yangl777 提交于 2022-09-14 14:17 . backport upstream patches
From 1459f3ca787e799eeddd40ca5abd28de1efc12b6 Mon Sep 17 00:00:00 2001
From: Aaron Conole <aconole@redhat.com>
Date: Wed, 25 Aug 2021 10:29:19 -0400
Subject: [PATCH] 8021qaz: squelch initialization errors
Some static analysis tools (like coverity) flag this array
as accessed without proper initialization. Squelch by forcing
initialization.
Conflict:NA
Reference:https://github.com/openSUSE/lldpad/commit/1459f3ca787e799eeddd40ca5abd28de1efc12b6
closes https://github.com/intel/openlldp/issues/77
Signed-off-by: Aaron Conole <aconole@redhat.com>
---
lldp_8021qaz_clif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldp_8021qaz_clif.c b/lldp_8021qaz_clif.c
index f776392..9031cb0 100644
--- a/lldp_8021qaz_clif.c
+++ b/lldp_8021qaz_clif.c
@@ -253,7 +253,7 @@ static void ieee8021qaz_print_app_tlv(u16 len, char *info)
{
u8 app, app_idx, app_prio, app_sel;
u16 proto, offset = 2;
- u8 dscp[MAX_USER_PRIORITIES][MAX_APP_ENTRIES];
+ u8 dscp[MAX_USER_PRIORITIES][MAX_APP_ENTRIES] = {0};
u8 dscp_count[MAX_USER_PRIORITIES] = {0};
u8 i, j;
bool first_app = true;
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化