1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-04 08:00:59 +01:00

Merge pull request #14183 from NixOS/backport-14156-to-2.31-maintenance

[Backport 2.31-maintenance] treewide: Squash some user-after-free bugs
This commit is contained in:
internal-nix-ci[bot] 2025-10-08 00:28:23 +00:00 committed by GitHub
commit 885499ace5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -324,7 +324,7 @@ void SampleStack::saveProfile()
std::visit([&](auto && info) { info.symbolize(state, os, posCache); }, pos); std::visit([&](auto && info) { info.symbolize(state, os, posCache); }, pos);
} }
os << " " << count; os << " " << count;
writeLine(profileFd.get(), std::move(os).str()); writeLine(profileFd.get(), os.str());
/* Clear ostringstream. */ /* Clear ostringstream. */
os.str(""); os.str("");
os.clear(); os.clear();

View file

@ -272,9 +272,10 @@ Goal::Co DerivationGoal::repairClosure()
bmRepair)); bmRepair));
} }
bool haveWaitees = !waitees.empty();
co_await await(std::move(waitees)); co_await await(std::move(waitees));
if (!waitees.empty()) { if (haveWaitees) {
trace("closure repaired"); trace("closure repaired");
if (nrFailed > 0) if (nrFailed > 0)
throw Error( throw Error(