To check the uniqueness of buildids, we held on to a StringRef of the build id string pushed into the vector. If the number of build ids were large enough to trigger a realloc in the vector then these references where invalidated resulting in a use-after free. This was exposed in downstream usage.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
lgtm but you could also consider collapsing both BuildIds and BuildIdsSet into a single SetVector for conciseness.
Comment Actions
I did consider this prior to sending out the patch. Since SetVector::takeVector return a SmallVector we need to either
- create a new result std::vector prior to avoid changing the return type, negating the benefit
- update the return type which breaks downstream usage and will need to be updated
Since this isn't performance critical I chose the simplest approach.