From 4be7a6680d28a33c81773e464e1c58c9d719e458 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 14 Sep 2016 15:48:07 +0200 Subject: Check the return value of get_component * TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp: --- TAO/tao/IORManipulation/IORManip_IIOP_Filter.cpp | 34 ++++++++++++++---------- 1 file 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 (buf), - tagged_component.component_data.length ()); + TAO_InputCDR in_cdr (reinterpret_cast (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 (byte_order)); + in_cdr.reset_byte_order (static_cast (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; } -- cgit v1.2.1