diff --git a/0001-Don-t-segfault-on-missing-priority-tag.patch b/0001-Don-t-segfault-on-missing-priority-tag.patch new file mode 100644 index 0000000..32a72dc --- /dev/null +++ b/0001-Don-t-segfault-on-missing-priority-tag.patch @@ -0,0 +1,39 @@ +From fd57fc716231c8296d340fdb4c0f6eac176f7f7c Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Fri, 20 Aug 2021 15:14:16 +0200 +Subject: [PATCH] Don't segfault on missing priority tag + +Resolves: #1636 +Related: #1638 +--- + lib/rpmtriggers.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/lib/rpmtriggers.c b/lib/rpmtriggers.c +index fc809a65e..d541974e8 100644 +--- a/lib/rpmtriggers.c ++++ b/lib/rpmtriggers.c +@@ -517,7 +517,8 @@ rpmRC runFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense, + if (matchFunc(ts, te, pfx, sense)) { + for (i = 0; i < rpmdbIndexIteratorNumPkgs(ii); i++) { + struct rpmtd_s priorities; +- unsigned int priority; ++ unsigned int priority = 0; ++ unsigned int *priority_ptr; + unsigned int offset = rpmdbIndexIteratorPkgOffset(ii, i); + unsigned int tix = rpmdbIndexIteratorTagNum(ii, i); + +@@ -535,7 +536,9 @@ rpmRC runFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense, + trigH = rpmdbGetHeaderAt(rpmtsGetRdb(ts), offset); + headerGet(trigH, priorityTag, &priorities, HEADERGET_MINMEM); + rpmtdSetIndex(&priorities, tix); +- priority = *rpmtdGetUint32(&priorities); ++ priority_ptr = rpmtdGetUint32(&priorities); ++ if (priority_ptr) ++ priority = *priority_ptr; + headerFree(trigH); + + /* Store file trigger in array */ +-- +2.45.1 + diff --git a/rpm.spec b/rpm.spec index 2aba89e..029c1e0 100644 --- a/rpm.spec +++ b/rpm.spec @@ -32,7 +32,7 @@ %global rpmver 4.16.1.3 #global snapver rc1 -%global rel 29 +%global rel 30 %global sover 9 %global srcver %{rpmver}%{?snapver:-%{snapver}} @@ -108,6 +108,7 @@ Patch134: 0001-Don-t-warn-about-missing-user-group-on-skipped-files.patch Patch140: 0001-Fix-short-circuiting-of-version-strings-in-expressio.patch Patch141: 0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch Patch142: 0001-Expose-and-document-rpmdb-verifydb-operation.patch +Patch143: 0001-Don-t-segfault-on-missing-priority-tag.patch # These are not yet upstream Patch906: rpm-4.7.1-geode-i686.patch @@ -657,6 +658,9 @@ fi %doc doc/librpm/html/* %changelog +* Mon Jun 03 2024 Michal Domonkos - 4.16.1.3-30 +- Don't segfault on missing priority tag (RHEL-35249) + * Wed Dec 13 2023 Florian Festi - 4.16.1.3-29 - Actually add --verifydb to the man page (RHEL-14591) - Don't warn about missing user/group on skipped files (RHEL-18037)