mirror of
https://github.com/go-gost/x.git
synced 2026-10-19 16:16:32 +00:00
WrapConn stores the target and only writes it on first I/O, but the connector encoded it into a bufpool buffer that was returned to the pool when Connect returned. A later Connect could reuse the backing array and overwrite the bytes, misrouting the first connection. Allocate the target per connection instead of sharing a pooled buffer. Regression test drives two Connect calls and asserts the first conn's wire target survives a second Connect reusing the pool.