[OE-core] [PATCH] rpm: fix segment fault in lib/psm.c
Zhixiong Chi
zhixiong.chi at windriver.com
Wed Jul 15 07:04:02 UTC 2015
Add null pointer checking for rpmpsmStage() function in lib/psm.c
Signed-off-by: Zhixiong Chi <zhixiong.chi at windriver.com>
---
.../rpm/rpm/rpm-fix-segment-fault-in-psm.patch | 34 ++++++++++++++++++++++
meta/recipes-devtools/rpm/rpm_5.4.14.bb | 1 +
2 files changed, 35 insertions(+)
create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-fix-segment-fault-in-psm.patch
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-fix-segment-fault-in-psm.patch b/meta/recipes-devtools/rpm/rpm/rpm-fix-segment-fault-in-psm.patch
new file mode 100644
index 0000000..e78ec4f
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-fix-segment-fault-in-psm.patch
@@ -0,0 +1,34 @@
+Summary: rpm: fix segment fault in psm.c
+
+When rpmtsGetRdb(ts) retrun NULL, it will output segment fault.
+
+Upstream-status: pending
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi at windriver.com>
+Index: rpm-5.4.14/lib/psm.c
+===================================================================
+--- rpm-5.4.14.orig/lib/psm.c 2015-06-18 10:57:15.949529544 +0800
++++ rpm-5.4.14/lib/psm.c 2015-07-15 14:56:13.362911386 +0800
+@@ -3026,13 +3026,15 @@
+ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
+ #endif
+
+- xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
+- rc = runInstScript(psm);
+- if (rc)
+- xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn);
+- else
+- xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
+- rpmtsGetRdb(ts)->db_txn = NULL;
++ if (rpmtsGetRdb(ts)) {
++ xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
++ rc = runInstScript(psm);
++ if (rc)
++ xx = rpmtxnAbort(rpmtsGetRdb(ts)->db_txn);
++ else
++ xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
++ rpmtsGetRdb(ts)->db_txn = NULL;
++ }
+ #ifdef RPM_VENDOR_OE
+ if (scriptletWrapper && *scriptletWrapper)
+ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
index fb81f12..3314da8 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.14.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -93,6 +93,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;e
file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
file://no-ldflags-in-pkgconfig.patch \
file://rpm-lua-fix-print.patch \
+ file://rpm-fix-segment-fault-in-psm.patch \
"
# Uncomment the following line to enable platform score debugging
--
1.9.1
More information about the Openembedded-core
mailing list