1 Star 0 Fork 29

openeuler_bot/iputils

forked from src-openEuler/iputils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-ping-fix-overflow-on-negative.patch 945 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhongxuan2 提交于 2024-04-01 06:29 . sync 22.03-sp1 patches
From 2a63b94313352ed62f47adbc1a0d33bfea7ca188 Mon Sep 17 00:00:00 2001
From: Petr Vorel <pvorel@suse.cz>
Date: Wed, 17 May 2023 00:57:24 +0200
Subject: [PATCH] ping: Fix overflow on negative -i
Restore back check for -i <= 0.
Fixes: 918e824 ("ping: add support for sub-second timeouts")
Closes: https://github.com/iputils/iputils/issues/465
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
ping/ping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ping/ping.c b/ping/ping.c
index 8f442037..27c72cad 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -436,7 +436,7 @@ main(int argc, char **argv)
double optval;
optval = ping_strtod(optarg, _("bad timing interval"));
- if (isgreater(optval, (double)INT_MAX / 1000))
+ if (islessequal(optval, 0) || isgreater(optval, (double)INT_MAX / 1000))
error(2, 0, _("bad timing interval: %s"), optarg);
rts.interval = (int)(optval * 1000);
rts.opt_interval = 1;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeulerbot/iputils.git
git@gitee.com:openeulerbot/iputils.git
openeulerbot
iputils
iputils
master

搜索帮助