Explorar o código

apt-pkg/contrib/srvrec.cc: res_query() should not generate a _error->Warning()

Michael Vogt %!s(int64=11) %!d(string=hai) anos
pai
achega
9b70edba67
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      apt-pkg/contrib/srvrec.cc

+ 2 - 0
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);