加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-sd-dhcp-lease-fix-an-infinite-loop-found-by-the-fuzz.patch 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
From c95ae2ba0093742292671fd30a63af15f1b63bc6 Mon Sep 17 00:00:00 2001
From: Evgeny Vereshchagin <evvers@ya.ru>
Date: Sat, 29 Jan 2022 02:08:39 +0000
Subject: [PATCH] sd-dhcp-lease: fix an infinite loop found by the fuzzer
(cherry picked from commit 86b06c666be8b7afb45541d35aa4d0ecb38056d1)
(cherry picked from commit 426807c54b9500b806eaaf50d32c7c936510706c)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/c95ae2ba0093742292671fd30a63af15f1b63bc6
---
src/libsystemd-network/sd-dhcp-lease.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index 9a0d7f6fea..75aa0c3d2c 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -463,10 +463,8 @@ static int lease_parse_routes(
route->option = SD_DHCP_OPTION_STATIC_ROUTE;
r = in4_addr_default_prefixlen((struct in_addr*) option, &route->dst_prefixlen);
- if (r < 0) {
- log_debug("Failed to determine destination prefix length from class based IP, ignoring");
- continue;
- }
+ if (r < 0)
+ return -EINVAL;
assert_se(lease_parse_be32(option, 4, &addr.s_addr) >= 0);
route->dst_addr = inet_makeaddr(inet_netof(addr), 0);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化