summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2016-09-14 15:48:07 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2016-09-14 15:48:07 +0200
commit4be7a6680d28a33c81773e464e1c58c9d719e458 (patch)
treefcbbc4a53ba066b78c68ec6e5809f0bff937f0f1
parentbbd816c5ddf6a8f44ccf6d5af520e134f578028b (diff)
downloadATCD-4be7a6680d28a33c81773e464e1c58c9d719e458.tar.gz
Check the return value of get_component
* TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp:
-rw-r--r--TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp b/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp
index 15c865ed9ef..5f15990b92d 100644
--- a/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp
+++ b/TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp
@@ -193,25 +193,31 @@ TAO_IORManip_IIOP_Filter::get_endpoints (TAO_Profile* profile,
const TAO_Tagged_Components& comps = profile->tagged_components ();
IOP::TaggedComponent tagged_component;
tagged_component.tag = TAO_TAG_ENDPOINTS;
- comps.get_component (tagged_component);
- // Prepare the CDR for endpoint extraction
- const CORBA::Octet *buf =
- tagged_component.component_data.get_buffer ();
+ if (comps.get_component (tagged_component))
+ {
+ // Prepare the CDR for endpoint extraction
+ const CORBA::Octet *buf =
+ tagged_component.component_data.get_buffer ();
- TAO_InputCDR in_cdr (reinterpret_cast<const char*> (buf),
- tagged_component.component_data.length ());
+ TAO_InputCDR in_cdr (reinterpret_cast<const char*> (buf),
+ tagged_component.component_data.length ());
- // Extract the Byte Order.
- CORBA::Boolean byte_order;
- if (!(in_cdr >> ACE_InputCDR::to_boolean (byte_order)))
- return 0;
+ // Extract the Byte Order.
+ CORBA::Boolean byte_order;
+ if (!(in_cdr >> ACE_InputCDR::to_boolean (byte_order)))
+ return 0;
- in_cdr.reset_byte_order (static_cast<int> (byte_order));
+ in_cdr.reset_byte_order (static_cast<int> (byte_order));
- // Extract endpoints sequence.
- if (!(in_cdr >> endpoints))
- return 0;
+ // Extract endpoints sequence.
+ if (!(in_cdr >> endpoints))
+ return 0;
+ }
+ else
+ {
+ return 0;
+ }
return 1;
}