1 Star 0 Fork 40

geruijun/multipath-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
6000-libmultipath-fix-set_int-error-path.patch 926 Bytes
一键复制 编辑 原始数据 按行查看 历史
wangjufeng 提交于 2020-01-10 17:13 . rename the package
From 8f9ac30dcb144d4ce79f88e8a01fba0968da3a07 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 9 Oct 2018 18:03:03 -0500
Subject: [PATCH] libmultipath: fix set_int error path
set_int() wasn't checking if the line actually had a value before
converting it to an integer. Found by coverity. Also, it should
be using set_value().
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dict.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index 32524d5f..bf4701ee 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -33,7 +33,10 @@ set_int(vector strvec, void *ptr)
int *int_ptr = (int *)ptr;
char * buff;
- buff = VECTOR_SLOT(strvec, 1);
+ buff = set_value(strvec);
+ if (!buff)
+ return 1;
+
*int_ptr = atoi(buff);
return 0;
--
2.11.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/geruijun/multipath-tools.git
git@gitee.com:geruijun/multipath-tools.git
geruijun
multipath-tools
multipath-tools
master

搜索帮助