mirror of
https://github.com/NixOS/nix
synced 2025-07-01 12:37:59 +02:00
Fix 32-bit overflow with --no-net
--no-net causes tarballTtl to be set to the largest 32-bit integer,
which causes comparison like 'time + tarballTtl < other_time' to
fail on 32-bit systems. So cast them to 64-bit first.
https://hydra.nixos.org/build/95076624
(cherry picked from commit 29ccb2e969
)
This commit is contained in:
parent
f8b30338ac
commit
64ec087f58
3 changed files with 7 additions and 10 deletions
|
@ -784,7 +784,7 @@ CachedDownloadResult Downloader::downloadCached(
|
|||
auto ss = tokenizeString<vector<string>>(readFile(dataFile), "\n");
|
||||
if (ss.size() >= 3 && ss[0] == url) {
|
||||
time_t lastChecked;
|
||||
if (string2Int(ss[2], lastChecked) && lastChecked + request.ttl >= time(0)) {
|
||||
if (string2Int(ss[2], lastChecked) && (uint64_t) lastChecked + request.ttl >= (uint64_t) time(0)) {
|
||||
skip = true;
|
||||
result.effectiveUri = request.uri;
|
||||
result.etag = ss[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue