diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-05-26 12:42:58 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-05-26 12:43:24 +0200 |
| commit | 6c3196950acb6a1351c221c74edd9c3ba691b7e5 (patch) | |
| tree | 976a714c2f5b05a6868188e221745f60f23f8288 /apt-pkg/solver3.cc | |
| parent | 9d0f306b3e1b4a485b6fb31e90ae849d2a46c636 (diff) | |
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.
Diffstat (limited to 'apt-pkg/solver3.cc')
| -rw-r--r-- | apt-pkg/solver3.cc | 2 |
1 files changed, 2 insertions, 0 deletions
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."); |
