Repository: activemq-cpp Updated Branches: refs/heads/3.8.x 08baa709a -> ac836a5bc refs/heads/trunk b8a98a3c0 -> a965f2b83
https://issues.apache.org/jira/browse/AMQCPP-550 Fix for potential NPE Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/a965f2b8 Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/a965f2b8 Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/a965f2b8 Branch: refs/heads/trunk Commit: a965f2b838a458a1e69fd80fac58bc14571af018 Parents: b8a98a3 Author: Timothy Bish <[email protected]> Authored: Wed Aug 20 16:16:14 2014 -0400 Committer: Timothy Bish <[email protected]> Committed: Wed Aug 20 16:16:14 2014 -0400 ---------------------------------------------------------------------- activemq-cpp/src/main/decaf/net/InetAddress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a965f2b8/activemq-cpp/src/main/decaf/net/InetAddress.cpp ---------------------------------------------------------------------- diff --git a/activemq-cpp/src/main/decaf/net/InetAddress.cpp b/activemq-cpp/src/main/decaf/net/InetAddress.cpp index 53576fb..9dff3d6 100644 --- a/activemq-cpp/src/main/decaf/net/InetAddress.cpp +++ b/activemq-cpp/src/main/decaf/net/InetAddress.cpp @@ -167,7 +167,7 @@ InetAddress InetAddress::getLocalHost() { apr_sockaddr_t* address = NULL; result = apr_sockaddr_info_get(&address, hostname, APR_UNSPEC, 0, APR_IPV4_ADDR_OK, pool.getAprPool()); - if (result != APR_SUCCESS) { + if (result != APR_SUCCESS || address == NULL) { throw UnknownHostException(__FILE__, __LINE__, "Could not resolve the IP Address of this host."); }
