Skip to content

Commit

Permalink
Merge pull request #7 from algorand/tsachi/byteslicelencheck
Browse files Browse the repository at this point in the history
Improve non-int bound checks
  • Loading branch information
tsachiherman authored Jun 11, 2020
2 parents 516d169 + 03396d7 commit 6c5e28f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gen/unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (u *unmarshalGen) gBase(b *BaseElem) {
u.p.printf("\n%s, err = msgp.ReadBytesBytesHeader(bts)", sz)
u.p.wrapErrCheck(u.ctx.ArgsStr())
u.p.printf("\nif %s > %s {", sz, b.common.AllocBound())
u.p.printf("\nerr = msgp.ErrOverflow(uint64(%s), %s)", sz, b.common.AllocBound())
u.p.printf("\nerr = msgp.ErrOverflow(uint64(%s), uint64(%s))", sz, b.common.AllocBound())
u.p.printf("\nreturn")
u.p.printf("\n}")
}
Expand Down

0 comments on commit 6c5e28f

Please sign in to comment.