mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 10:02:00 -08:00
Do not copy more bytes than were read
This commit is contained in:
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user