Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create slice copies where needed

  • Loading branch information...
commit 1f2a6c59576ccaa58f2352e974ae05a10b4c2fe5 1 parent a69ec5a
@pietern pietern authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 reader.go
View
6 reader.go
@@ -41,7 +41,8 @@ func (self *readMessage) read(line []byte, rd *bufio.Reader) (err error) {
// Skip +MSG
idx := 1
- self.Subscription = chunks[idx]
+ self.Subscription = make([]byte, len(chunks[idx]))
+ copy(self.Subscription, chunks[idx])
idx += 1
sid, err := strconv.ParseUint(string(chunks[idx]), 10, 0)
@@ -53,7 +54,8 @@ func (self *readMessage) read(line []byte, rd *bufio.Reader) (err error) {
if len(chunks) == 5 {
idx += 1
- self.ReplyTo = chunks[idx]
+ self.ReplyTo = make([]byte, len(chunks[idx]))
+ copy(self.ReplyTo, chunks[idx])
}
idx += 1
Please sign in to comment.
Something went wrong with that request. Please try again.