]> Cypherpunks repositories - gostls13.git/commit
math/big: fix uint64 overflow in nat.mulRange
authorRobert Griesemer <gri@golang.org>
Mon, 8 Jan 2024 21:28:59 +0000 (13:28 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 9 Jan 2024 15:29:36 +0000 (15:29 +0000)
commitaba18d5b6785d501996b475d58a05cc26707d370
tree00466900b0b6212f37108b67dc807f65ce43a9d2
parent821f94103b2980758cdb21ac6ae834ef0a07235a
math/big: fix uint64 overflow in nat.mulRange

Compute median as a + (b-a)/2 instead of (a + b)/2.
Add additional test cases.

Fixes #65025.

Change-Id: Ib716a1036c17f8f33f51e33cedab13512eb7e0be
Reviewed-on: https://go-review.googlesource.com/c/go/+/554617
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/math/big/int_test.go
src/math/big/nat.go
src/math/big/nat_test.go