From 9b70edba6796ebff3935af1cfb5c9bbc98d020b4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 18 Aug 2015 16:46:34 +0200 Subject: [PATCH] apt-pkg/contrib/srvrec.cc: res_query() should not generate a _error->Warning() --- apt-pkg/contrib/srvrec.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apt-pkg/contrib/srvrec.cc b/apt-pkg/contrib/srvrec.cc index 1dcda8b54..85241c1d7 100644 --- a/apt-pkg/contrib/srvrec.cc +++ b/apt-pkg/contrib/srvrec.cc @@ -41,6 +41,8 @@ bool GetSrvRecords(std::string name, std::vector &Result) return _error->Errno("res_init", "Failed to init resolver"); answer_len = res_query(name.c_str(), C_IN, T_SRV, answer, sizeof(answer)); + if (answer_len == -1) + return false; if (answer_len < (int)sizeof(HEADER)) return _error->Warning("Not enough data from res_query (%i)", answer_len); -- 2.45.2