From c476086e9336b681d365cd18ce1c96135a1ddb31 Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Wed, 27 Dec 2023 14:56:33 -0500 Subject: Prevent infinite loop in `ReadConfigFile` Break the loop on failure. Without this, the function goes into an infinite loop if `FName` is a directory. --- apt-pkg/contrib/configuration.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 1134ed667..a5f97729c 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -858,7 +858,7 @@ bool ReadConfigFile(Configuration &Conf,const string &FName,bool const &AsSectio int CurLine = 0; bool InComment = false; - while (F.Eof() == false) + while (F.Eof() == false && F.Failed() == false) { // The raw input line. std::string Input; -- cgit v1.2.3-70-g09d2