libdnf/0001-db-Don-t-crash-when-a-package-has-no-origin.patch
Kalev Lember 4e9f5de55c Backport a fix for a packagekit crasher / F29 Beta blocker (#1626851)
QA asked me to do a build with what's in stable (libdnf-0.17.0-2.fc29) +
the crasher fix, so I'm abusing git merge a bit to get bug fixes on top
of an older build.
2018-09-12 22:10:29 +02:00

39 lines
1.2 KiB
Diff

From ccf8b4945ba6a7c888237ff0b439153b79740d80 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Wed, 12 Sep 2018 15:24:05 +0200
Subject: [PATCH] db: Don't crash when a package has no origin
This fixes a NULL pointer dereference in a debug print that was causing
packagekitd crashes.
https://bugzilla.redhat.com/show_bug.cgi?id=1626851
---
libdnf/dnf-db.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libdnf/dnf-db.cpp b/libdnf/dnf-db.cpp
index 5b28288f..894703d3 100644
--- a/libdnf/dnf-db.cpp
+++ b/libdnf/dnf-db.cpp
@@ -36,8 +36,6 @@
void
dnf_db_ensure_origin_pkg(DnfDb *db, DnfPackage *pkg)
{
- g_autoptr(GError) error = NULL;
-
/* already set */
if (dnf_package_get_origin(pkg) != NULL)
return;
@@ -47,7 +45,7 @@ dnf_db_ensure_origin_pkg(DnfDb *db, DnfPackage *pkg)
/* set from the database if available */
auto tmp = db->getRPMRepo(dnf_package_get_nevra(pkg));
if (tmp.empty()) {
- g_debug("no origin for %s: %s", dnf_package_get_package_id(pkg), error->message);
+ g_debug("no origin for %s", dnf_package_get_package_id(pkg));
} else {
dnf_package_set_origin(pkg, tmp.c_str());
}
--
2.19.0.rc0