authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-10-23 09:58:47+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-10-23 09:58:47+02:00
log1bbafbc65fafb9075f343ba18a42acd5e0f93e62
tree9d43829703022b4f592645d64fefd25567d9e3d9
parent4a2f1e748e5f92eed70006e1732076e6017f541a

macho: increment temp buffer when calculating hashes


1 files changed, 2 insertions(+), 2 deletions(-)

src/link/MachO/CodeSignature.zig+2-2
......@@ -284,7 +284,7 @@ pub fn writeAdhocSignature(
284284
285285 try self.code_directory.code_slots.ensureTotalCapacityPrecise(gpa, total_pages);
286286 self.code_directory.code_slots.items.len = total_pages;
287 self.code_directory.inner.nCodeSlots += total_pages;
287 self.code_directory.inner.nCodeSlots = total_pages;
288288
289289 // Calculate hash for each page (in file) and write it to the buffer
290290 var wg: WaitGroup = .{};
......@@ -308,7 +308,7 @@ pub fn writeAdhocSignature(
308308 const out_hash = &self.code_directory.code_slots.items[i];
309309 wg.start();
310310 try comp.thread_pool.spawn(workerSha256Hash, .{
311 opts.file, fstart, buffer[0..fsize], out_hash, &results[i], &wg,
311 opts.file, fstart, buffer[fstart..][0..fsize], out_hash, &results[i], &wg,
312312 });
313313 }
314314 }