From 13f0260beae851f7d5dd96e9ef757d8d6d7daac1 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 9 Feb 2020 07:20:13 -0800 Subject: [PATCH] Fix false overlapped components detection on 32-bit systems. 32-bit systems with ZIP64_SUPPORT enabled could have different size types for zoff_t and zusz_t. That resulted in bad parameter passing to the bound tracking functions, itself due to the lack of use of C function prototypes in unzip. This commit assures that parameters are cast properly for those calls. This problem occurred only for ill-chosen make options, which give a 32-bit zoff_t. A proper build will result in a zoff_t of 64 bits, even on 32-bit systems. --- extract.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extract.c b/extract.c index 1b73cb0..d9866f9 100644 --- a/extract.c +++ b/extract.c @@ -329,7 +329,7 @@ static ZCONST char Far OverlappedComponents[] = /* A growable list of spans. */ -typedef zoff_t bound_t; +typedef zusz_t bound_t; typedef struct { bound_t beg; /* start of the span */ bound_t end; /* one past the end of the span */ @@ -518,7 +518,8 @@ int extract_or_test_files(__G) /* return PK-type error code */ return PK_MEM; } if ((G.extra_bytes != 0 && - cover_add((cover_t *)G.cover, 0, G.extra_bytes) != 0) || + cover_add((cover_t *)G.cover, + (bound_t)0, (bound_t)G.extra_bytes) != 0) || (G.ecrec.have_ecr64 && cover_add((cover_t *)G.cover, G.ecrec.ec64_start, G.ecrec.ec64_end) != 0) || @@ -1216,7 +1217,7 @@ static int extract_or_test_entrylist(__G__ numchunk, /* seek_zipf(__G__ pInfo->offset); */ request = G.pInfo->offset + G.extra_bytes; - if (cover_within((cover_t *)G.cover, request)) { + if (cover_within((cover_t *)G.cover, (bound_t)request)) { Info(slide, 0x401, ((char *)slide, LoadFarString(OverlappedComponents))); return PK_BOMB; 7d6d8340'>root/tests/grafts.scm
AgeCommit message (Expand)Author
2023-10-28grafts: Fix corner case involving multiple-output derivations....Fixes a bug that would occur with references to two outputs of the same derivation, with one of them referring to the other one. For example, the references of libreoffice include both mariadb:dev and mariadb:lib; additionally, mariadb:dev refers to mariadb:lib. In this case, the glibc graft would not be applied on one of the mariadb paths, and both the grafted and ungrafted glibc would end up in the closure of libreoffice. Fixes <https://issues.guix.gnu.org/66662>. * guix/grafts.scm (non-self-references): Simplify and include references to outputs of DRV other than OUTPUTS. (reference-origins): Simplify and possibly return outputs of DRV itself. (cumulative-grafts)[graft-origin?]: Add OUTPUT parameter and honor it. [dependency-grafts]: Adjust accordingly. * tests/grafts.scm ("graft-derivation, multiple outputs need to be replaced"): New test. Change-Id: Iac2005024ab7049037537b3af55298696ec90e3c Ludovic Courtès
2022-11-11grafts: Run with a UTF-8 locale....Fixes <https://issues.guix.gnu.org/55968>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/grafts.scm (%graft-with-utf8-locale?): New parameter. (graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New variables. [build]: Use 'set-utf8-locale'. * tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set '%graft-with-utf8-locale?' to #f. Ludovic Courtès