From 65b3813a8069e61568e881828b86d29b650082af Mon Sep 17 00:00:00 2001 From: renxichen Date: Tue, 26 Sep 2023 07:11:02 +0000 Subject: [PATCH] Fix potential segmentation fault --- Generate-digest-lists.patch | 9 ++++++--- rpm.spec | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Generate-digest-lists.patch b/Generate-digest-lists.patch index 4332042..fbad245 100644 --- a/Generate-digest-lists.patch +++ b/Generate-digest-lists.patch @@ -8,8 +8,8 @@ This patch helps to generate digest lists during rpm building process. Signed-off-by: Roberto Sassu Signed-off-by: Tianxing Zhang --- - build/files.c | 301 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 291 insertions(+), 10 deletions(-) + build/files.c | 304 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 294 insertions(+), 10 deletions(-) diff --git a/build/files.c b/build/files.c index c43deb5..613de67 100644 @@ -327,7 +327,7 @@ index c43deb5..613de67 100644 * Add directory (and all of its files) to the package manifest. * @param fl package file tree walk data * @param diskPath path to file -@@ -2556,6 +2767,58 @@ static void addPackageFileList (struct FileList_s *fl, Package pkg, +@@ -2556,6 +2767,61 @@ static void addPackageFileList (struct FileList_s *fl, Package pkg, argvFree(fileNames); } @@ -351,6 +351,9 @@ index c43deb5..613de67 100644 + if (!(s && *s)) + goto exit; + ++ if (!strchr(binRpm, '/')) ++ goto exit; ++ + av_brp[2] = strchr(binRpm, '/') + 1; + rpmlog(RPMLOG_NOTICE, _("Generating digest list: %s\n"), s); + diff --git a/rpm.spec b/rpm.spec index 02108cb..c58b943 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.15.1 -Release: 53 +Release: 54 Summary: RPM Package Manager License: GPLv2+ URL: http://www.rpm.org/ @@ -505,6 +505,9 @@ make check || (cat tests/rpmtests.log; exit 0) %{_mandir}/man1/gendiff.1* %changelog +* Tue Sep 26 2023 renhongxun - 4.15.1-54 +- Fix potential segmentation fault + * Tue Sep 05 2023 renhongxun - 4.15.1-53 - Fix the coredump which may occur during upgrading of rpm