diff options
Diffstat (limited to 'backport-Fix-possible-null-pointer-reference-in-ndb.patch')
| -rw-r--r-- | backport-Fix-possible-null-pointer-reference-in-ndb.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/backport-Fix-possible-null-pointer-reference-in-ndb.patch b/backport-Fix-possible-null-pointer-reference-in-ndb.patch new file mode 100644 index 0000000..b2aeb03 --- /dev/null +++ b/backport-Fix-possible-null-pointer-reference-in-ndb.patch @@ -0,0 +1,28 @@ +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 + |
