0 Star 0 Fork 76

Liquor/rpm

forked from src-openEuler/rpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-pointer-dereference-before-testing-for-NULL-in-r.patch 797 Bytes
一键复制 编辑 原始数据 按行查看 历史
Liquor 提交于 2021-01-11 11:10 . backport patches from upstream
From c886b359ba5f05eec6a8da34b55437834b7d80ee Mon Sep 17 00:00:00 2001
From: Panu Matilainen <[email protected]>
Date: Thu, 6 Feb 2020 14:51:14 +0200
Subject: [PATCH] Fix pointer dereference before testing for NULL in
rpmtdGetNumber()
---
lib/rpmtd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/rpmtd.c b/lib/rpmtd.c
index e33c8cb53..41c6a50e8 100644
--- a/lib/rpmtd.c
+++ b/lib/rpmtd.c
@@ -210,12 +210,12 @@ const char * rpmtdGetString(rpmtd td)
uint64_t rpmtdGetNumber(rpmtd td)
{
- uint64_t val = 0;
- int ix = (td->ix >= 0 ? td->ix : 0);
-
if (td == NULL)
return 0;
+ uint64_t val = 0;
+ int ix = (td->ix >= 0 ? td->ix : 0);
+
switch (td->type) {
case RPM_INT64_TYPE:
val = *((uint64_t *) td->data + ix);
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liquor1/rpm.git
[email protected]:liquor1/rpm.git
liquor1
rpm
rpm
master

搜索帮助