Check if drv is initialized in DerivationGoal::waiteeDone

It might not be set, in which case we shouldn't do anything.
Surprisingly, this somehow did not cause segfaults before?

Caught by UBSan.
This commit is contained in:
Las Safin 2024-07-16 21:38:19 +00:00
parent 5b6a21acc5
commit a1f3f103bc
No known key found for this signature in database

View file

@ -1569,7 +1569,7 @@ void DerivationGoal::waiteeDone(GoalPtr waitee, ExitCode result)
{
Goal::waiteeDone(waitee, result);
if (!useDerivation) return;
if (!useDerivation || !drv) return;
auto & fullDrv = *dynamic_cast<Derivation *>(drv.get());
auto * dg = dynamic_cast<DerivationGoal *>(&*waitee);