Skip to content

Commit

Permalink
Merge pull request #2 from altenhof/master
Browse files Browse the repository at this point in the history
Pull request for issue #1
  • Loading branch information
crewjam authored Oct 8, 2016
2 parents 2edeb89 + 3a9bdbb commit 20c0f21
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ func (m *Message) UnmarshalBinary(inputBuffer []byte) error {
// MSG-ANY = *OCTET ; not starting with BOM
// MSG-UTF8 = BOM UTF-8-STRING
// BOM = %xEF.BB.BF
m.Message = r.Bytes()

// To be on the safe side, remaining stuff is copied over
m.Message = copyFrom(r.Bytes())
return nil
}

Expand Down Expand Up @@ -435,3 +437,9 @@ func readWord(r io.RuneScanner) (string, error) {
}
}
}

func copyFrom(in []byte ) []byte {
out := make([]byte,len(in))
copy(out, in)
return out
}

0 comments on commit 20c0f21

Please sign in to comment.