[llvm-branch-commits] [libcxx] release/22.x: [libc++] Fix vector::append_range growing before the capacity is reached (#183264) (PR #183722)

Nikolas Klauser via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Feb 28 05:37:50 PST 2026


philnik777 wrote:

Maybe to make it a bit more clear:
```c++
#include <vector>

auto test(std::vector<int>& v) {
  v.reserve(v.size() + 10);
  auto ret = v.data();
  int arr[10] = {};
  v.append_range(arr);
  return *ret;
}
```
is a completely valid program, which has a potential use-after-free due to this bug.

https://github.com/llvm/llvm-project/pull/183722


More information about the llvm-branch-commits mailing list