From: Michael Vogt Date: Tue, 18 Aug 2015 14:46:34 +0000 (+0200) Subject: apt-pkg/contrib/srvrec.cc: res_query() should not generate a _error->Warning() X-Git-Tag: 1.1.exp10~5^2~1 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/9b70edba6796ebff3935af1cfb5c9bbc98d020b4 apt-pkg/contrib/srvrec.cc: res_query() should not generate a _error->Warning() --- 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);