!352 [sync] PR-351: 回合上游补丁

From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2024-07-24 02:55:38 +00:00 committed by Gitee
commit b5d95e62eb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From 1849c99826fdc64e8bd0847675e28e2619c64de6 Mon Sep 17 00:00:00 2001
From: Florian Festi <ffesti@redhat.com>
Date: Mon, 13 May 2024 15:42:07 +0200
Subject: [PATCH] Free old cookie value to prevent a memory leak
This keeps the old behaviour of overriding the cookie. This may not me
correct as the code looks like it reads the cookie from the srpm when
doing rpmbuild --rebuild for the purpose of preserving it. Otoh the
current behaviour with overriding it even in this case has been around
for years. This whole cookie business seems to have some other issues,
too, and needs further investigation. Here we are only trying to fix the
memory leak.
---
build/pack.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/build/pack.c b/build/pack.c
index 4318a6132f..e87d66deb6 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -472,6 +472,7 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp,
/* Create and add the cookie */
if (cookie) {
+ free(*cookie);
rasprintf(cookie, "%s %d", buildHost, buildTime);
headerPutString(pkg->header, RPMTAG_COOKIE, *cookie);
}

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.18.2
Release: 6
Release: 7
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -32,6 +32,7 @@ Patch6010: backport-An-enumeration-is-not-a-bitfield-use-an-integer-inst.patch
Patch6011: backport-Fix-an-enum-int-type-mismatch-in-rpmfiArchiveReadToF.patch
Patch6012: backport-Fix-an-enum-int-type-mismatch-in-transaction-verify-.patch
Patch6013: backport-Fix-enum-type-mismatch-in-rpmTagGetValue.patch
Patch6014: backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch
Patch9000: Add-digest-list-plugin.patch
Patch9001: Add-IMA-digest-list-support.patch
@ -330,6 +331,9 @@ make clean
%exclude %{_mandir}/man8/rpmspec.8.gz
%changelog
* Tue Jul 23 2024 zhangxingrong <zhangxingrong@uniontech.cn> - 4.18.2-7
- Free old cookie value to prevent a memory leak
* Mon Jun 3 2024 gengqihu<gengqihu2@h-partners.com> - 4.18.2-6
- Backport some patches from upstream