!282 Fix potential segmentation fault

From: @renxichen 
Reviewed-by: @xujing99 
Signed-off-by: @xujing99
This commit is contained in:
openeuler-ci-bot 2023-09-26 11:09:53 +00:00 committed by Gitee
commit 8aa781a4d1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 4 deletions

View File

@ -8,8 +8,8 @@ This patch helps to generate digest lists during rpm building process.
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Tianxing Zhang <zhangtianxing3@huawei.com>
---
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);
+

View File

@ -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<renhongxun@h-partners.com> - 4.15.1-54
- Fix potential segmentation fault
* Tue Sep 05 2023 renhongxun<renhongxun@h-partners.com> - 4.15.1-53
- Fix the coredump which may occur during upgrading of rpm