]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix error checking on one getaddrinfo call 9578/head
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Fri, 2 Oct 2020 09:20:21 +0000 (11:20 +0200)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Fri, 2 Oct 2020 09:20:24 +0000 (11:20 +0200)
pdns/notify.cc

index 597b833492343320445e175d98c2ef861d9574d6..69fb936813cb38edb081a17cee0dc23088ea329d 100644 (file)
@@ -97,7 +97,7 @@ try
        parts.push_back("domain");
      else if (parts.size() != 2)
        throw runtime_error("Invalid hostname:port syntax");
-     if (getaddrinfo(parts[0].c_str(), parts[1].c_str(), NULL, &info) < 0)
+     if (getaddrinfo(parts[0].c_str(), parts[1].c_str(), NULL, &info) != 0)
        throw runtime_error("Cannot resolve '" + string(argv[1]) +"'");
      for(auto ptr = info; ptr != NULL; ptr = ptr->ai_next)
        addrs.emplace(ComboAddress{ptr->ai_addr, ptr->ai_addrlen});