Commit 54454fd
committed
std.math.big.int: breaking API changes to prevent UAF
Many of the Managed methods accepted by-val parameters which could
reference Limb slices that became invalid memory after any
ensureCapacity calls. Now, Managed methods accept `*const Managed`
parameters so that if the function allows aliasing and the
ensure-capacity call resizes the Limb slice, it also affects the
aliased parameters, avoiding use-after-free bugs.
This is a breaking change that reduces the requirement for callsites to
manually make the ensure-capacity changes prior to calling many of the
Managed methods.
Closes #118971 parent 8f2f0d8 commit 54454fd
File tree
5 files changed
+299
-283
lines changed- lib/std/math/big
- src
5 files changed
+299
-283
lines changed
0 commit comments