mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2025-11-05 17:53:44 -08:00
Do not copy more bytes than were read
This commit is contained in:
committed by
Mickaël Rémond
parent
ffadd331dd
commit
38bdcaec36
@@ -100,7 +100,7 @@ func (t WebsocketTransport) startReader() {
|
||||
if n > 0 {
|
||||
// We need to make a copy, otherwise we will overwrite the slice content
|
||||
// on the next iteration of the for loop.
|
||||
tmp := make([]byte, len(buffer))
|
||||
tmp := make([]byte, n)
|
||||
copy(tmp, buffer)
|
||||
t.queue <- tmp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user