From 6c3196950acb6a1351c221c74edd9c3ba691b7e5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 26 May 2025 12:42:58 +0200 Subject: solver3: Initialize startTime if not set in Pop() If the user pushes Assumptions that fail, we could inadvertently timeout during the Pop() as the variable was not initialized. Always initialize it to 0, and if we haven't set an actual time by the time we Pop() set it there. --- apt-pkg/solver3.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/solver3.cc') diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 489d4081b..eeac6f177 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -947,6 +947,8 @@ bool APT::Solver::Pop() return false; time_t now = time(nullptr); + if (startTime == 0) + startTime = now; if (now - startTime >= Timeout) return _error->Error("Solver timed out."); -- cgit v1.2.3-70-g09d2