Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/std/crypto/Certificate/Bundle/macos.zig
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,16 @@ pub fn rescanMac(cb: *Bundle, gpa: Allocator) RescanMacError!void {
}

for (record_list) |record_offset| {
// An offset of zero means that the record is not present.
// An offset that is not 4-byte-aligned is invalid.
if (record_offset == 0 or record_offset % 4 != 0) continue;

try stream.seekTo(db_header.schema_offset + table_offset + record_offset);

const cert_header = try reader.readStructEndian(X509CertHeader, .big);

if (cert_header.cert_size == 0) continue;

try cb.bytes.ensureUnusedCapacity(gpa, cert_header.cert_size);

const cert_start = @as(u32, @intCast(cb.bytes.items.len));
Expand Down