]> Cypherpunks repositories - gostls13.git/commit
strings: limits allocation size for SplitN
authorPhilippe Antoine <contact@catenacyber.fr>
Sun, 20 Mar 2022 21:34:42 +0000 (21:34 +0000)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 31 Mar 2022 05:24:51 +0000 (05:24 +0000)
commitcc46cac3bc59c35e22e17471d70e28fd3705d4da
tree5747d4965353da5507413d7ffbf90e6e2ceace5a
parent90b29e186576d2682c024b0f0b90c6ad98e824d7
strings: limits allocation size for SplitN

So that `strings.SplitN("", "T", int(144115188075855872))` does not panic.

Change-Id: Iea00417e61780bcaf0fee02fa2b18026d89bc545
GitHub-Last-Rev: d1f45b44a8011ddb27c71e1bc9983b62b5d3d771
GitHub-Pull-Request: golang/go#51755
Reviewed-on: https://go-review.googlesource.com/c/go/+/393654
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
src/strings/strings.go
src/strings/strings_test.go