# Skip empty/invalid records/certs in MacOS keychain files · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0779e847f79851419dfeb39595b1817ce72ea9fa)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0779e847f79851419dfeb39595b1817ce72ea9fa

Requested commit: 0779e847f79851419dfeb39595b1817ce72ea9fa

Commit: 0779e847f79851419dfeb39595b1817ce72ea9fa

Tree: 82ece10dcab4917af58ac4b0063a29f52f50de52

Author: Ryan Liptak

Committer: Alex Rønne Petersen

## Message

```
Skip empty/invalid records/certs in MacOS keychain files

In the original PR that implemented this (https://github.com/ziglang/zig/pull/14325), it included a list of references for the keychain format. Multiple of those references include the checks that are added in this commit, and empirically this fixes the loading of a real keychain file that was previously failing (it had both a record with offset 0 and a record with cert_size 0).

Fixes #22870

```

## Parents

- [d2e70ef84a912947f6485f6fc480030c2d6a8c8f](https://git.cafe/gitcafe/zig/commit/d2e70ef84a912947f6485f6fc480030c2d6a8c8f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0779e847f79851419dfeb39595b1817ce72ea9fa?format=markdown)
