Skip to content

Bug: Agent.name stores borrowed memory (use-after-free risk) #2

@justrach

Description

@justrach

Severity: Critical

AgentRegistry.register() stores name without duping it. In HTTP and MCP flows, this can point into short-lived request buffers that get freed/reused, causing use-after-free.

Fix: Dupe name in register(), free in deinit().

Files: src/agent.zig:57-66, src/server.zig:53, src/mcp.zig:77

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:p2Medium prioritystatus:doneWork item is complete

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions