making sure that sourceEnd for data.copy does not exceed data.length
Merge pull request #92 from utobi/issue-#65-sourceEnd-out-of-bounds-fix

quick fix for issue #65