Repair Partial Read Truncation Bugs

    by Mariusz Wrzeszczynski

    1

    Repair partial reads, truncated frames, stream-chunk/message confusion, early EOF acceptance, and stale decoder state.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLI+17 more

    See it in action

    You say

    Our Go TCP client reads a 4-byte length header with conn.Read(header) once, then allocates the payload and calls conn.Read(payload) once. Under packet fragmentation we occasionally decode truncated protobuf messages. Repair locally with a deterministic fragmenting reader and loopback sockets. Preserve the existing frame format and maximum-frame setting. Do not connect to production or invent new framing.

    Your agent does

    Partial-read bug found. Header and payload readers assume one read returns the requested length. The repair uses exact-length reads, explicit truncation errors, preserves the existing frame limit, and adds deterministic fragmented/coalesced input tests.

    What you get

    Repair code assuming recv(n) always returns n bytesImplement incremental framed decoders for binary protocolsAdd deterministic tests for one-byte fragment scenariosEnforce bounded buffering for stream reconstruction

    About this skill

    A read call is not a message boundary. TCP, TLS, files, and async streams may return fewer bytes than requested, split one frame across many chunks, or coalesce several frames together. Code that assumes one read returns everything can silently feed truncated data into parsers.

    This skill fixes exact-length reads and incremental framing, distinguishes clean EOF from truncation, preserves bounded streaming, and adds deterministic fragmentation/coalescing tests.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Frequently Asked Questions

    Popular in AI Agents & LLM Ops