mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-01-15 15:12:41 +08:00
- Use named constant for dataChan buffer size - Add bounds checking to prevent panic if n > len(data) - Only send valid data portion (buf[:n]) to dataChan - Use sync.Once to prevent double-close panic in Close() - Add comment explaining data loss risk (acceptable for UDP-like behavior) All tests pass, no security vulnerabilities found. Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>