代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/fcoe-utils 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From b9885692cb283a674e04528486984fb61f92a190 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 23 Mar 2021 11:21:17 -0700
Subject: [PATCH] fix VLAN device name overflow check
check snprintf return for truncation
Signed-off-by: Chris Leech <cleech@redhat.com>
---
fipvlan.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/fipvlan.c b/fipvlan.c
index fe8d7955cc5..3ce913d5eaf 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -624,8 +624,16 @@ create_and_start_vlan(struct fcf *fcf, bool vn2vn)
real_dev->ifname, fcf->vlan, vlan->ifname);
rc = 0;
} else {
- snprintf(vlan_name, IFNAMSIZ, "%s.%d%s",
- real_dev->ifname, fcf->vlan, config.suffix);
+ rc = snprintf(vlan_name, IFNAMSIZ, "%s.%d%s",
+ real_dev->ifname, fcf->vlan,
+ config.suffix);
+ if (rc < 0 || rc >= IFNAMSIZ) {
+ printf("Failed to create VLAN device "
+ "(name %s.%d%s is too long)\n",
+ real_dev->ifname, fcf->vlan,
+ config.suffix);
+ return -EINVAL;
+ }
rc = vlan_create(fcf->ifindex, fcf->vlan, vlan_name);
if (rc < 0)
printf("Failed to create VLAN device %s\n\t%s\n",
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。