commit b490237f809cf7593cfa7de0bbb48050e27993a6 from: Stefan Sperling via: Thomas Adam date: Wed Jan 12 21:11:53 2022 UTC fix file corruption regression in 'got checkout' caused by commit db696021 got-read-pack must rewind its files temporary files before reusing them. Problem reported by naddy ok tracey naddy commit - 1944573a096bbe0d2b80dd1644f01383b9353af5 commit + b490237f809cf7593cfa7de0bbb48050e27993a6 blob - 42db173ef1b6dbec1e36f988932ceaaf62802922 blob + 69a1daf4a2c1047bb38b4801085ed055ac118786 --- lib/pack.c +++ lib/pack.c @@ -1119,6 +1119,11 @@ got_pack_dump_delta_chain_to_file(size_t *result_size, return got_error_from_errno("malloc"); base_file = NULL; accum_file = NULL; + } else { + if (fseeko(base_file, 0L, SEEK_SET) == -1) + return got_error_from_errno("fseeko"); + if (fseeko(accum_file, 0L, SEEK_SET) == -1) + return got_error_from_errno("fseeko"); } /* Deltas are ordered in ascending order. */