Skip to content

Commit

Permalink
Merge pull request #211 from gcash/op_cat
Browse files Browse the repository at this point in the history
Fix bug in OP_CAT
  • Loading branch information
cpacia authored Apr 11, 2019
2 parents c732e1a + d8ed730 commit 8940e19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion txscript/opcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,9 @@ func opcodeCat(op *parsedOpcode, vm *Engine) error {
if err != nil {
return err
}
c := append(a, b...)
c := make([]byte, len(a)+len(b))
copy(c[:len(a)], a)
copy(c[len(a):], b)
if len(c) > MaxScriptElementSize {
str := fmt.Sprintf("concatenated size %d exceeds max allowed size %d",
len(c), MaxScriptElementSize)
Expand Down

0 comments on commit 8940e19

Please sign in to comment.