public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Fix division by zero in elfdeps
@ 2026-11-23  9:35 Michal Domonkos
  0 siblings, 0 replies; only message in thread
From: Michal Domonkos @ 2026-11-23  9:35 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : 22bb2476ce1535fc7d501aa41df0a979c7f2632a
            Author : Michal Domonkos <mdomonko@redhat.com>
            Date   : 2024-08-01T12:25:29+02:00
            Stats  : +32/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/22bb2476ce1535fc7d501aa41df0a979c7f2632a?branch=pmatilai-v6

            Log:
            Fix division by zero in elfdeps

Fixes: #2299414

---
diff --git a/0001-Fix-division-by-zero-in-elfdeps-RhBug-2299414.patch b/0001-Fix-division-by-zero-in-elfdeps-RhBug-2299414.patch
new file mode 100644
index 0000000..c540f00
--- /dev/null
+++ b/0001-Fix-division-by-zero-in-elfdeps-RhBug-2299414.patch
@@ -0,0 +1,27 @@
+From 02ffc5158d1ad270e0b5c7ce6dfe4414a6ec029f Mon Sep 17 00:00:00 2001
+From: Michal Domonkos <mdomonko@redhat.com>
+Date: Wed, 31 Jul 2024 16:19:40 +0200
+Subject: [PATCH] Fix division by zero in elfdeps (RhBug:2299414)
+
+Assume that the section does not hold a table if sh_entsize is 0 (as
+specified in the elf(5) man page) and just skip it if that's the case.
+---
+ tools/elfdeps.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tools/elfdeps.c b/tools/elfdeps.c
+index cb388f08d..822359ab9 100644
+--- a/tools/elfdeps.c
++++ b/tools/elfdeps.c
+@@ -196,6 +196,8 @@ static void processVerNeed(Elf_Scn *scn, GElf_Shdr *shdr, elfInfo *ei)
+ static void processDynamic(Elf_Scn *scn, GElf_Shdr *shdr, elfInfo *ei)
+ {
+     Elf_Data *data = NULL;
++    if (shdr->sh_entsize == 0)
++	return;
+     while ((data = elf_getdata(scn, data)) != NULL) {
+ 	for (int i = 0; i < (shdr->sh_size / shdr->sh_entsize); i++) {
+ 	    const char *s = NULL;
+-- 
+2.45.2
+

diff --git a/rpm.spec b/rpm.spec
index 53dff16..0403115 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -27,7 +27,7 @@
 
 %global rpmver 4.19.92
 #global snapver rc1
-%global baserelease 5
+%global baserelease 6
 %global sover 10
 
 %global srcver %{rpmver}%{?snapver:-%{snapver}}
@@ -151,6 +151,7 @@ rpm-4.19.91-weak-user-group.patch
 
 # These are not yet upstream
 rpm-4.7.1-geode-i686.patch
+0001-Fix-division-by-zero-in-elfdeps-RhBug-2299414.patch
 
 %description
 The RPM Package Manager (RPM) is a powerful command line driven
@@ -650,6 +651,9 @@ fi
 %doc %{_defaultdocdir}/rpm/API/
 
 %changelog
+* Thu Aug 01 2024 Michal Domonkos <mdomonko@redhat.com> - 4.19.92-6
+- Fix division by zero in elfdeps (#2299414)
+
 * Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.19.92-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:35 [rpms/rpm] pmatilai-v6: Fix division by zero in elfdeps Michal Domonkos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox