1 Star 0 Fork 80

houlifei/rpm

forked from src-openEuler/rpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-possible-null-pointer-reference-in-ndb.patch 863 Bytes
一键复制 编辑 原始数据 按行查看 历史
renxichen 提交于 2023-08-02 16:25 . backport some patches from upstream
From 8ec9cfc81c3f8326a1c7ee5b795ef517cd48e6b4 Mon Sep 17 00:00:00 2001
From: yuxiaojun <yuxiaojun1011@outlook.com>
Date: Wed, 14 Jun 2023 11:23:24 +0800
Subject: [PATCH] Fix possible null pointer reference in ndb
slot1 and slot2 may be NULL
Signed-off-by: yuxiaojun <yuxiaojun1011@outlook.com>
---
lib/backend/ndb/rpmxdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/backend/ndb/rpmxdb.c b/lib/backend/ndb/rpmxdb.c
index 2c1f29842..d9c373cb0 100644
--- a/lib/backend/ndb/rpmxdb.c
+++ b/lib/backend/ndb/rpmxdb.c
@@ -755,7 +755,7 @@ static int moveblobstofront(rpmxdb xdb, struct xdb_slot *afterslot)
if (slot2 == xdb->slots)
slot2 = 0;
}
- if (slot1->pagecnt < slot2->pagecnt) {
+ if (slot1 && slot2 && slot1->pagecnt < slot2->pagecnt) {
struct xdb_slot *tmp = slot1;
slot1 = slot2;
slot2 = tmp;
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/houlifei_uniontech/rpm.git
git@gitee.com:houlifei_uniontech/rpm.git
houlifei_uniontech
rpm
rpm
master

搜索帮助