1 Star 0 Fork 28

zero/open-iscsi

forked from src-openEuler/open-iscsi 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0010-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
Wenchao Hao 提交于 2022-02-08 19:31 . Remove useless patch
From 424d5967e94f6adf4c0669d390779af8da0bef20 Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Sat, 18 Sep 2021 16:10:50 -0700
Subject: [PATCH] Fix compiler error introduced with recent IPv6 commit.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 76350316de38 ("Handle IPv6 interfaces correctly.") added
a string copy that creates this gcc-11 error message:
> gcc-11 -O2 -g -Wall -Werror -Wextra -fvisibility=hidden -fPIC -I/usr/include/kmod -c -o idbm.o idbm.c
> idbm.c: In function ‘_idbm_node_rec_link’:
> idbm.c:999:17: error: ‘strncpy’ specified bound 65 equals destination size [-Werror=stringop-truncation]
> 999 | strncpy((*node).iface.name, iface_name, ISCSI_MAX_IFACE_LEN);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So copy one less character, maximum.
---
libopeniscsiusr/idbm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libopeniscsiusr/idbm.c b/libopeniscsiusr/idbm.c
index b2524ed..6f57e45 100644
--- a/libopeniscsiusr/idbm.c
+++ b/libopeniscsiusr/idbm.c
@@ -996,7 +996,7 @@ static void _idbm_node_rec_link(struct iscsi_node *node, struct idbm_rec *recs,
/* use the interface name passed in, if any */
if (iface_name)
- strncpy((*node).iface.name, iface_name, ISCSI_MAX_IFACE_LEN);
+ strncpy((*node).iface.name, iface_name, ISCSI_MAX_IFACE_LEN-1);
/*
* Note: because we do not add the iface.iscsi_ifacename to
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wubo009/open-iscsi.git
git@gitee.com:wubo009/open-iscsi.git
wubo009
open-iscsi
open-iscsi
master

搜索帮助