# fix\(desktop\): reject a malformed Safari jar instead of importing part of it · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/39ef01166faaf849806cf502c1517cd5baed7d3b)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 39ef01166faaf849806cf502c1517cd5baed7d3b

Requested commit: 39ef01166faaf849806cf502c1517cd5baed7d3b

Commit: 39ef01166faaf849806cf502c1517cd5baed7d3b

Tree: 4f6db50558a8903c621222909173202f8dff27ff

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(desktop): reject a malformed Safari jar instead of importing part of it

`Buffer.subarray` clamps rather than throwing, so every declared structure in
the binary format was taken on trust. An overlong page swallowed the following
page's bytes and pushed the cursor past the end, dropping every cookie after
the boundary from an import that still reported success. A record whose
declared size overran its page left its string offsets free to read the next
record's bytes as this cookie's value.

Pages, records, and string offsets are now bounds-checked against what the file
actually contains, and a mismatch fails the read.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

```

## Parents

- [2b608c083d15e0841793f9d076d1d3d722ea931b](https://git.cafe/pingdotgg/t3code/commit/2b608c083d15e0841793f9d076d1d3d722ea931b?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/39ef01166faaf849806cf502c1517cd5baed7d3b?format=markdown)
