summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp4
-rw-r--r--TAO/tao/SHMIOP_Acceptor.cpp4
-rw-r--r--TAO/tao/UIOP_Acceptor.cpp4
3 files changed, 12 insertions, 0 deletions
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index 8aeb05d71b4..7f2e628ccce 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -124,6 +124,10 @@ TAO_IIOP_Acceptor::is_collocated (const TAO_Profile *pfile)
ACE_dynamic_cast (const TAO_IIOP_Profile *,
pfile);
+ // Make sure the dynamically cast pointer is valid.
+ if (profile == 0)
+ return 0;
+
for (size_t i = 0; i < this->num_hosts_; ++i)
{
// compare the port and sin_addr (numeric host address)
diff --git a/TAO/tao/SHMIOP_Acceptor.cpp b/TAO/tao/SHMIOP_Acceptor.cpp
index 0a3dc351921..7fc649bb91a 100644
--- a/TAO/tao/SHMIOP_Acceptor.cpp
+++ b/TAO/tao/SHMIOP_Acceptor.cpp
@@ -121,6 +121,10 @@ TAO_SHMIOP_Acceptor::is_collocated (const TAO_Profile *pfile)
ACE_dynamic_cast(const TAO_SHMIOP_Profile *,
pfile);
+ // Make sure the dynamically cast pointer is valid.
+ if (profile == 0)
+ return 0;
+
// compare the port and sin_addr (numeric host address)
return this->address_.same_host (profile->object_addr ());
}
diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp
index c7ea477dec9..94dbd9cd13b 100644
--- a/TAO/tao/UIOP_Acceptor.cpp
+++ b/TAO/tao/UIOP_Acceptor.cpp
@@ -129,6 +129,10 @@ TAO_UIOP_Acceptor::is_collocated (const TAO_Profile *pfile)
ACE_dynamic_cast (const TAO_UIOP_Profile *,
pfile);
+ // Make sure the dynamically cast pointer is valid.
+ if (profile == 0)
+ return 0;
+
// For UNIX Files this is relatively cheap.
ACE_UNIX_Addr address;
if (this->base_acceptor_.acceptor ().get_local_addr (address) == -1)