Mageia Bugzilla – Attachment 8525 Details for
Bug 19571
overflow when querying for size with urpmq
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
fix reporting size on big packages (mga#19571)
0001-fix-reporting-size-on-big-packages-mga-19571.patch (text/plain), 1.35 KB, created by
Thierry Vignaud
on 2016-10-13 13:09:06 CEST
(
hide
)
Description:
fix reporting size on big packages (mga#19571)
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2016-10-13 13:09:06 CEST
Size:
1.35 KB
patch
obsolete
>From 7da83829ba2a64b578515692fdfac61f06de4824 Mon Sep 17 00:00:00 2001 >From: Thierry Vignaud <thierry.vignaud@gmail.com> >Date: Thu, 13 Oct 2016 13:05:32 +0200 >Subject: [PATCH] fix reporting size on big packages (mga#19571) > >--- > URPM.xs | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > >diff --git a/URPM.xs b/URPM.xs >index 41a6b8c..bd0c6f8 100644 >--- a/URPM.xs >+++ b/URPM.xs >@@ -201,13 +201,12 @@ get_arch(const Header header) { > return headerIsEntry(header, RPMTAG_SOURCERPM) ? get_name(header, RPMTAG_ARCH) : "src"; > } > >-static int >+static uint64_t > get_int(const Header header, rpmTag tag) { > struct rpmtd_s val; > >- headerGet(header, tag, &val, HEADERGET_DEFAULT); >- uint32_t *ep = rpmtdGetUint32(&val); >- return ep ? *ep : 0; >+ headerGet(header, tag, &val, HEADERGET_ALLOC); >+ return rpmtdGetNumber(&val); > } > > static size_t >@@ -755,8 +754,7 @@ pack_header(const URPM__Package pkg) { > const char *p = buff; > const char *nvr = headerGetAsString(pkg->h, RPMTAG_NVR); > const char *arch = get_arch(pkg->h); >- >- p += 1 + snprintf(buff, sizeof(buff), "%s.%s@%d@%d@%s", nvr, arch, >+ p += 1 + snprintf(buff, sizeof(buff), "%s.%s@%lu@%lu@%s", nvr, arch, > get_int(pkg->h, RPMTAG_EPOCH), get_int(pkg->h, RPMTAG_SIZE), > get_name(pkg->h, RPMTAG_GROUP)); > pkg->info = memcpy(malloc(p-buff), buff, p-buff); >-- >2.10.1 >
From 7da83829ba2a64b578515692fdfac61f06de4824 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud <thierry.vignaud@gmail.com> Date: Thu, 13 Oct 2016 13:05:32 +0200 Subject: [PATCH] fix reporting size on big packages (mga#19571) --- URPM.xs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/URPM.xs b/URPM.xs index 41a6b8c..bd0c6f8 100644 --- a/URPM.xs +++ b/URPM.xs @@ -201,13 +201,12 @@ get_arch(const Header header) { return headerIsEntry(header, RPMTAG_SOURCERPM) ? get_name(header, RPMTAG_ARCH) : "src"; } -static int +static uint64_t get_int(const Header header, rpmTag tag) { struct rpmtd_s val; - headerGet(header, tag, &val, HEADERGET_DEFAULT); - uint32_t *ep = rpmtdGetUint32(&val); - return ep ? *ep : 0; + headerGet(header, tag, &val, HEADERGET_ALLOC); + return rpmtdGetNumber(&val); } static size_t @@ -755,8 +754,7 @@ pack_header(const URPM__Package pkg) { const char *p = buff; const char *nvr = headerGetAsString(pkg->h, RPMTAG_NVR); const char *arch = get_arch(pkg->h); - - p += 1 + snprintf(buff, sizeof(buff), "%s.%s@%d@%d@%s", nvr, arch, + p += 1 + snprintf(buff, sizeof(buff), "%s.%s@%lu@%lu@%s", nvr, arch, get_int(pkg->h, RPMTAG_EPOCH), get_int(pkg->h, RPMTAG_SIZE), get_name(pkg->h, RPMTAG_GROUP)); pkg->info = memcpy(malloc(p-buff), buff, p-buff); -- 2.10.1
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19571
:
8522
|
8523
|
8525
|
8528
|
8529
|
8530
|
8531
|
8537
|
8538
|
8539
|
8541
|
8542
|
8543
|
8547
|
8548
|
8549
|
8563
|
8564
|
8565
|
8566