File: src/server/server.zig:2156-2174; src/buffer.zig:14-88
Severity: HIGH
Status: ✅ FIXED
paneClipboardCallback rejects OSC52 payloads whose decoded size exceeds
MAX_PASTE_SIZE (16 KiB) before allocating.BufferList gained max_buffers = 50; push/pushOwned evict the oldest
entry when full, so every yank/click no longer accumulates a permanent
"bufferN".Test: buffer list evicts oldest past max_buffers — bug #363
(5 pushes at cap 3 leave the newest three, oldest two freed).
paneClipboardCallback decodes an arbitrary-size base64 payload and stores
it permanently. MAX_PASTE_SIZE — enforced in the yank/paste paths
(cmdPasteBuffer, cmd.zig:471) — is never consulted here.BufferList has no entry limit: every mouse yank / click-selection /
OSC52 push adds "bufferN" forever. tmux defaults to ~50 buffers.Enforce MAX_PASTE_SIZE in the OSC52 path (reject or truncate with a log
line), and add MAX_BUFFERS eviction of the oldest entry in
buffers.pushOwned. Regression tests: oversized payload rejected; pushing
limit+1 buffers evicts the oldest.