Skip to content

Commit

Permalink
std.math.big.int: breaking API changes to prevent UAF
Browse files Browse the repository at this point in the history
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 #11897
  • Loading branch information
andrewrk committed Jun 30, 2022
1 parent 8f2f0d8 commit 54454fd
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 283 deletions.
Loading

0 comments on commit 54454fd

Please sign in to comment.