]> Cypherpunks repositories - gostls13.git/commit
bytes: limit allocation in SplitN
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 5 Apr 2022 20:28:16 +0000 (20:28 +0000)
committerIan Lance Taylor <iant@golang.org>
Wed, 6 Apr 2022 03:13:34 +0000 (03:13 +0000)
commit5bb2628c6f143be065776727cef03276c0e516f7
tree2774ecf154be141211a2f0b472b1379a4dce9160
parent6c17529af785d14fd317e19f878327539ea6cd47
bytes: limit allocation in SplitN

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

Change-Id: I7c068852bd708416164fc2ed8b84cf6b2d593666
GitHub-Last-Rev: f8df09d65e2bc889fbd0c736bfb5e9a9078dfced
GitHub-Pull-Request: golang/go#52147
Reviewed-on: https://go-review.googlesource.com/c/go/+/398076
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: mzh <mzh@golangcn.org>
src/bytes/bytes.go
src/bytes/bytes_test.go