1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00

fix buffer reuse bug

This commit is contained in:
Shelikhoo 2021-12-29 22:29:07 +00:00 committed by Xiaokang Wang (Shelikhoo)
parent c4f850f1a9
commit 899b8fefca

View File

@ -24,8 +24,9 @@ func AttachAddressToPacket(data []byte, address gonet.Addr) []byte {
if err != nil { if err != nil {
panic(err) panic(err)
} }
//Incorrect buffer reuse
data = append(packetBuf.Bytes(), data...) data = append(packetBuf.Bytes(), data...)
packetBuf.Release() //packetBuf.Release()
return data return data
} }