[Rpm-maint] [rpm-software-management/rpm] Allow database probing if _db_backend is not set (#1451)

Michael Schroeder notifications at github.com
Thu Dec 3 09:09:57 UTC 2020


@mlschroe commented on this pull request.



> @@ -77,7 +78,7 @@ dbDetectBackend(rpmdb rdb)
 	}
     }
 
-    if (!cfg) {
+    if (!cfg && ((rdb->db_mode & O_ACCMODE) != O_RDONLY || (rdb->db_flags & RPMDB_FLAG_REBUILD) != 0)) {

Maybe not for rpm itself, but I think it should stay to guard against bad librpm users. Otherwise it'll crash with a null pointer deref below in the REBUILD case when trying to print the warning message.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1451#discussion_r534981777
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201203/f123bea8/attachment-0001.html>


More information about the Rpm-maint mailing list