]> Cypherpunks repositories - gostls13.git/commit
strings, bytes: panic if Repeat overflows or if given a negative count
authorEmmanuel Odeke <emm.odeke@gmail.com>
Wed, 28 Sep 2016 08:54:38 +0000 (01:54 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 1 Oct 2016 15:47:35 +0000 (15:47 +0000)
commit7b40b0c3a332cbfaa1eb17bdafd2ddf12119ec45
treeb7472b36ac1bd223188ba3ba11082b0b328f5f3f
parentd166a369a89ef2d81efdc5d49fa782ee1c0186c4
strings, bytes: panic if Repeat overflows or if given a negative count

Panic if Repeat is given a negative count or
if the value of (len(*) * count) is detected
to overflow.
We panic because we cannot change the
signature of Repeat to return an error.

Fixes #16237

Change-Id: I9f5ba031a5b8533db0582d7a672ffb715143f3fb
Reviewed-on: https://go-review.googlesource.com/29954
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/bytes/bytes.go
src/bytes/bytes_test.go
src/strings/strings.go
src/strings/strings_test.go