From 388b5f1abe8947978592d9778a5669e634b6e552 Mon Sep 17 00:00:00 2001 From: Kane York Date: Thu, 23 Jul 2020 19:05:41 -0700 Subject: fix(3p/nix): fix null pointer dereferences Change-Id: I4c37febcd4978f17720b2526c267c6bf96e84bcc Reviewed-on: https://cl.tvl.fyi/c/depot/+/1417 Tested-by: BuildkiteCI Reviewed-by: tazjin --- third_party/nix/src/build-remote/build-remote.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src') diff --git a/third_party/nix/src/build-remote/build-remote.cc b/third_party/nix/src/build-remote/build-remote.cc index 82ac2014ef75..0aeadd0510d2 100644 --- a/third_party/nix/src/build-remote/build-remote.cc +++ b/third_party/nix/src/build-remote/build-remote.cc @@ -147,7 +147,7 @@ static int _main(int argc, char* argv[]) { continue; } bool best = false; - if (!bestSlotLock) { + if (!bestMachine || !bestSlotLock) { best = true; } else if (load / m.speedFactor < bestLoad / bestMachine->speedFactor) { @@ -170,7 +170,7 @@ static int _main(int argc, char* argv[]) { } } - if (!bestSlotLock) { + if (!bestSlotLock || !bestMachine) { if (rightType && !canBuildLocally) { std::cerr << "# postpone\n"; } else { -- cgit 1.4.1