1
0
mirror of https://github.com/golang/go synced 2024-11-05 17:46:16 -07:00
go/src/strings
Emmanuel Odeke 7b40b0c3a3 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>
2016-10-01 15:47:35 +00:00
..
compare_test.go all: single space after period. 2016-03-02 00:13:47 +00:00
compare.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
example_test.go
export_test.go
reader_test.go strings, bytes: fix Reader 0 byte read at EOF 2016-05-03 21:01:13 +00:00
reader.go all: use SeekStart, SeekCurrent, SeekEnd 2016-05-06 00:10:41 +00:00
replace_test.go
replace.go
search_test.go
search.go
strings_amd64.go strings: use AVX2 for Index if available 2016-09-07 10:43:13 +00:00
strings_decl.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
strings_generic.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
strings_test.go strings, bytes: panic if Repeat overflows or if given a negative count 2016-10-01 15:47:35 +00:00
strings.go strings, bytes: panic if Repeat overflows or if given a negative count 2016-10-01 15:47:35 +00:00
strings.s