summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 16:46:34 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 16:46:34 +0200
commit9b70edba6796ebff3935af1cfb5c9bbc98d020b4 (patch)
tree8d90b56bdd00ae9ba71ba84eef91f9e84efd3e10
parentcdeb54d4626ddc841d8898a8283084a8de3b25ee (diff)
apt-pkg/contrib/srvrec.cc: res_query() should not generate a _error->Warning()
-rw-r--r--apt-pkg/contrib/srvrec.cc2
1 files changed, 2 insertions, 0 deletions
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<SrvRec> &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);