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(...@@ -284,7 +284,7 @@ pub fn writeAdhocSignature(
284284
285 try self.code_directory.code_slots.ensureTotalCapacityPrecise(gpa, total_pages);285 try self.code_directory.code_slots.ensureTotalCapacityPrecise(gpa, total_pages);
286 self.code_directory.code_slots.items.len = total_pages;286 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
289 // Calculate hash for each page (in file) and write it to the buffer289 // Calculate hash for each page (in file) and write it to the buffer
290 var wg: WaitGroup = .{};290 var wg: WaitGroup = .{};
...@@ -308,7 +308,7 @@ pub fn writeAdhocSignature(...@@ -308,7 +308,7 @@ pub fn writeAdhocSignature(
308 const out_hash = &self.code_directory.code_slots.items[i];308 const out_hash = &self.code_directory.code_slots.items[i];
309 wg.start();309 wg.start();
310 try comp.thread_pool.spawn(workerSha256Hash, .{310 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,
312 });312 });
313 }313 }
314 }314 }