]> git.saurik.com Git - apt.git/commitdiff
apt-pkg/contrib/srvrec.cc: res_query() should not generate a _error->Warning()
authorMichael Vogt <mvo@debian.org>
Tue, 18 Aug 2015 14:46:34 +0000 (16:46 +0200)
committerMichael Vogt <mvo@debian.org>
Tue, 18 Aug 2015 14:46:34 +0000 (16:46 +0200)
apt-pkg/contrib/srvrec.cc

index 1dcda8b5490f5701f9f45032cc37be1303897604..85241c1d791d600ee4b5cf77c4bc826cef433bc8 100644 (file)
@@ -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));
       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);
 
    if (answer_len < (int)sizeof(HEADER))
       return _error->Warning("Not enough data from res_query (%i)", answer_len);