Files
Siegfried Pammer 4d42b38af1 Handle truncated XALZ input via EndOfStreamException, not length checks
Pre-checking stream.Length before reading is racy (the stream can shrink
between check and read) and not every stream knows its length ahead of
time. Instead, catch EndOfStreamException at each read: a stream too
short for the magic is passed through as not-XALZ, and a truncated
header or payload after a confirmed magic is rejected as
InvalidDataException. stream.Length remains only a sizing hint for the
payload buffer.

Assisted-by: Claude:claude-fable-5:Claude Code
2026-07-06 20:19:17 +02:00
..