public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: Fix segfault when trying to use unknown database backend
Date: Mon, 23 Nov 2026 09:33:21 GMT	[thread overview]
Message-ID: <179542640171.1.12612346212944970844.rpms-rpm-422abdab3263@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 422abdab3263df6ecf211ff86e046af7132bab25
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2020-05-12T12:56:04+03:00
Stats  : +34/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/422abdab3263df6ecf211ff86e046af7132bab25?branch=pmatilai-v6

Log:
Fix segfault when trying to use unknown database backend

---
diff --git a/0001-Fix-regression-causing-segfault-on-database-autodete.patch b/0001-Fix-regression-causing-segfault-on-database-autodete.patch
new file mode 100644
index 0000000..bf46531
--- /dev/null
+++ b/0001-Fix-regression-causing-segfault-on-database-autodete.patch
@@ -0,0 +1,29 @@
+From 853c48ba6468ce1a516621a2fa6d1fc51e4f7410 Mon Sep 17 00:00:00 2001
+Message-Id: <853c48ba6468ce1a516621a2fa6d1fc51e4f7410.1589277227.git.pmatilai@redhat.com>
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Thu, 2 Apr 2020 09:14:36 +0300
+Subject: [PATCH] Fix regression causing segfault on database autodetection
+
+If configuration points to non-existent backend, tryBackend() will
+segfault on the first call. Duh. Regression introduced in commit
+3eb0eed3806b41efdf86f0433d0b5d7d6c953561.
+---
+ lib/backend/dbi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/backend/dbi.c b/lib/backend/dbi.c
+index b51fc7ba3..94823b14c 100644
+--- a/lib/backend/dbi.c
++++ b/lib/backend/dbi.c
+@@ -52,7 +52,7 @@ dbiIndex dbiNew(rpmdb rdb, rpmDbiTagVal rpmtag)
+ static int tryBackend(const char *dbhome, const struct rpmdbOps_s *be)
+ {
+     int rc = 0;
+-    if (be->path) {
++    if (be && be->path) {
+ 	char *path = rstrscat(NULL, dbhome, "/", be->path, NULL);
+ 	rc = (access(path, F_OK) == 0);
+ 	free(path);
+-- 
+2.26.2
+

diff --git a/rpm.spec b/rpm.spec
index cd7bd1a..4f69c25 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -25,7 +25,7 @@
 
 %global rpmver 4.15.90
 %global snapver git14971
-%global rel 11
+%global rel 12
 
 %global srcver %{rpmver}%{?snapver:-%{snapver}}
 %global srcdir %{?snapver:testing}%{!?snapver:rpm-%(echo %{rpmver} | cut -d'.' -f1-2).x}
@@ -64,6 +64,7 @@ Patch101: 0001-rpmfc-Do-not-prepend-buildroot-to-a-path-for-paramet.patch
 Patch102: 0001-Fix-regression-causing-all-ELF-files-classified-as-O.patch
 Patch103: 0001-Warn-on-undefined-components-in-buildtree-macros.patch
 Patch104: 0001-Don-t-look-into-source-package-provides-in-depsolvin.patch
+Patch105: 0001-Fix-regression-causing-segfault-on-database-autodete.patch
 
 # These are not yet upstream
 Patch906: rpm-4.7.1-geode-i686.patch
@@ -551,6 +552,9 @@ fi
 %doc doc/librpm/html/*
 
 %changelog
+* Tue May 12 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.12
+- Fix segfault when trying to use unknown database backend
+
 * Thu May 7 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.11
 - Flag BDB databases for rebuild on next reboot whenever rpm is updated
 - Switch default database to sqlite (#1818910)

                 reply	other threads:[~2026-11-23  9:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542640171.1.12612346212944970844.rpms-rpm-422abdab3263@fedoraproject.org \
    --to=pmatilai@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox