szn

Bug 423 — Resource-bound limits cluster

423. Resource-bound limits cluster: config source-file recursion (stack overflow), no client cap, and the 16 MiB parser vs 8 MiB screen sixel mismatch

Severity: LOW Status: ✅ RESOLVED

(a) .source_file => try self.loadConfigFile(path) (:3329-3331) recurses with no depth guard: a config that sources itself — directly or cyclically — recurses until stack overflow, each level holding GPA-allocated file contents. (b) Every accepted socket permanently allocates an 8 KiB MessageReader (:2369) with no cap on client count; only the 128-entry listen backlog bounds it. (c) The parser buffers DCS payloads up to 16 MiB (input.zig:508) while Screen discards images over MAX_SIXEL_DATA = 8 MiB (screen.zig:11, drop at :245-252) — payloads 8-16 MiB are fully buffered (and, per #360/#405, arena-retained) before being thrown away; dcs_buf/osc_buf keep peak capacity for the pane’s life via clearRetainingCapacity (input.zig:88,513).

Fix: depth counter on config loads; max-clients (respond busy beyond it); align the two caps and free oversized buffers’ capacity.