!281 [sync] PR-277: Fix potential segmentation fault

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

View File

@ -4,8 +4,8 @@ Date: Thu, 12 Mar 2020 17:29:55 +0100
Subject: [PATCH 1/3] Generate digest lists
---
build/files.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 169 insertions(+), 7 deletions(-)
build/files.c | 179 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 171 insertions(+), 7 deletions(-)
diff --git a/build/files.c b/build/files.c
index 6dfd801c8..ab6938d8c 100644
@ -207,7 +207,7 @@ index 6dfd801c8..ab6938d8c 100644
/**
* Add directory (and all of its files) to the package manifest.
* @param fl package file tree walk data
@@ -2556,6 +2652,58 @@ static void addPackageFileList (struct FileList_s *fl, Package pkg,
@@ -2556,6 +2652,61 @@ static void addPackageFileList (struct FileList_s *fl, Package pkg,
argvFree(fileNames);
}
@ -231,6 +231,9 @@ index 6dfd801c8..ab6938d8c 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.17.0
Release: 30
Release: 31
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -403,6 +403,9 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Tue Sep 26 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-31
- Fix potential segmentation fault
* Fri Sep 08 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-30
- support _disable_auto_rebuilddb macro in posttrans