commit | 7afbb205c205659ed0f073c83434376016884d82 | [log] [tgz] |
---|---|---|
author | Aaron Green <aarongreen@google.com> | Thu Nov 30 01:29:49 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Nov 30 01:29:49 2023 +0000 |
tree | fafadbb9f6d5af1c0af1950bd773c500afdbc343 | |
parent | 8750debc3c31d37b7896ecf896849c4545f44142 [diff] |
pw_allocator: Fix use-after-free in ~AllocatorForTest This CL adds a `Reset` method to `AllocatorForTest` that must be called before the destructor if `Init` has been called. This avoids a use-after-free scenario when the memory backing the allocator is owned by a derived class, as with `AllocatorForTestWithBuffer`. Change-Id: Id15c022ae3666666b44c192f0d5e4d087dfec49d Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/182950 Reviewed-by: Taylor Cramer <cramertj@google.com> Commit-Queue: Aaron Green <aarongreen@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.