atproto utils for zig zat.dev
atproto sdk zig

fix 6 issues from code review: overflow, empty CID, varint, CAR roots master

Fixes from thorough code review: - skipValue: arg.val * 2 overflow on crafted map headers (use std.math.mul) - peekTypeAt: @intCast panic on huge map count (use std.math.cast) - readUvarint: 10th byte silently truncated (reject byte > 1 at shift 63) - readUvarint: use u7 shift to avoid saturation arithmetic - Reject empty CIDs (just 0x00 prefix, no version/codec bytes) in both the high-level decoder and the low-level readCidLink - CAR reader: reject non-CID values in roots array (was silently skipping) - MST loadFromBlocks: remove unnecessary 512-byte buffer copy for root key Add 4 tests: varint 10th byte overflow/acceptance, empty CID rejection, too-short CID rejection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


+63 -16
4 changed files