mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
Merge pull request #14156 from NixOS/fix-ub
treewide: Squash some user-after-free bugs
This commit is contained in:
commit
34bca9212a
2 changed files with 3 additions and 2 deletions
|
|
@ -324,7 +324,7 @@ void SampleStack::saveProfile()
|
|||
std::visit([&](auto && info) { info.symbolize(state, os, posCache); }, pos);
|
||||
}
|
||||
os << " " << count;
|
||||
writeLine(profileFd.get(), std::move(os).str());
|
||||
writeLine(profileFd.get(), os.str());
|
||||
/* Clear ostringstream. */
|
||||
os.str("");
|
||||
os.clear();
|
||||
|
|
|
|||
|
|
@ -272,9 +272,10 @@ Goal::Co DerivationGoal::repairClosure()
|
|||
bmRepair));
|
||||
}
|
||||
|
||||
bool haveWaitees = !waitees.empty();
|
||||
co_await await(std::move(waitees));
|
||||
|
||||
if (!waitees.empty()) {
|
||||
if (haveWaitees) {
|
||||
trace("closure repaired");
|
||||
if (nrFailed > 0)
|
||||
throw Error(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue