Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP5:GA
rpm.33599
sigreserved.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sigreserved.diff of Package rpm.33599
--- sign/rpmgensig.c.orig 2024-02-23 13:26:21.461857566 +0000 +++ sign/rpmgensig.c 2024-02-27 15:31:47.194980154 +0000 @@ -762,27 +762,20 @@ static int rpmSign(const char *rpm, int res = -1; } - /* Try to make new signature smaller to have size of original signature */ - rpmtdReset(&utd); + /* Adjust reserved size for added/removed signatures */ if (headerGet(sigh, RPMSIGTAG_RESERVEDSPACE, &utd, HEADERGET_MINMEM)) { - int diff; - int count; - char *reservedSpace = NULL; - - count = utd.count; - diff = headerSizeof(sigh, HEADER_MAGIC_YES) - origSigSize; + int diff = headerSizeof(sigh, HEADER_MAGIC_YES) - origSigSize; - if (diff < count) { - reservedSpace = xcalloc(count - diff, sizeof(char)); - headerDel(sigh, RPMSIGTAG_RESERVEDSPACE); - rpmtdReset(&utd); - utd.tag = RPMSIGTAG_RESERVEDSPACE; - utd.count = count - diff; - utd.type = RPM_BIN_TYPE; - utd.data = reservedSpace; - headerPut(sigh, &utd, HEADERPUT_DEFAULT); - free(reservedSpace); - insSig = 1; + /* diff can be zero if nothing was added or removed */ + if (diff) { + utd.count -= diff; + if (utd.count > 0 && utd.count < origSigSize) { + char *zeros = xcalloc(utd.count, sizeof(*zeros)); + utd.data = zeros; + headerMod(sigh, &utd); + insSig = 1; + free(zeros); + } } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor