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/ac836a5b Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/ac836a5b Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/ac836a5b Branch: refs/heads/3.8.x Commit: ac836a5bc082c6dcb95acd3ac013cb564ca22d57 Parents: 08baa70 Author: Timothy Bish <[email protected]> Authored: Wed Aug 20 16:16:14 2014 -0400 Committer: Timothy Bish <[email protected]> Committed: Wed Aug 20 16:25:05 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/ac836a5b/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."); }
