1 Star 0 Fork 98

huajingyun/systemd_1

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-udev-builtin-net_id-fix-potential-buffer-overflow.patch 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
胡宇彪 提交于 2023-12-18 16:36 . sync patches from systemd community
From 5660e68d651545b43e13a51b068e64022637a6c6 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <[email protected]>
Date: Wed, 28 Sep 2022 18:09:29 +0900
Subject: [PATCH] udev-builtin-net_id: fix potential buffer overflow
Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/5660e68d651545b43e13a51b068e64022637a6c6
---
src/udev/udev-builtin-net_id.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 4936ba518a..d1f343573d 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -948,11 +948,11 @@ static int names_usb(sd_device *dev, NetNames *names) {
/* append USB config number, suppress the common config == 1 */
if (!streq(config, "1"))
- l = strpcpyl(&s, sizeof(names->usb_ports), "c", config, NULL);
+ l = strpcpyl(&s, l, "c", config, NULL);
/* append USB interface number, suppress the interface == 0 */
if (!streq(interf, "0"))
- l = strpcpyl(&s, sizeof(names->usb_ports), "i", interf, NULL);
+ l = strpcpyl(&s, l, "i", interf, NULL);
if (l == 0)
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENAMETOOLONG),
"Generated USB name would be too long.");
--
2.39.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huajingyun/systemd_1.git
[email protected]:huajingyun/systemd_1.git
huajingyun
systemd_1
systemd_1
master

搜索帮助