From 864b6a1452fd53a9c12fe80cda32db91d6943fac Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 10 Mar 2017 17:42:01 +0100 Subject: orber: Remove hard dependency to external atom format The 20 bytes limit is to avoid doing binary_to_term on a huge term in vain, just to conclude is was not atom 'undefined'. --- .../COSS/CosNaming/CosNaming_NamingContextExt_impl.erl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/orber/COSS') diff --git a/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl b/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl index 8f7da2425b..620c91d406 100644 --- a/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl +++ b/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl @@ -610,11 +610,16 @@ convert_list([{N, T, _O}|Rest], HowMany, Counter, Acc) -> %% Returns : %%---------------------------------------------------------------------- destroy(OE_THIS, OE_State) -> - case corba:get_subobject_key(OE_THIS) of - <<131,100,0,9,117,110,100,101,102,105,110,101,100>> -> - %% undefined binary. - corba:raise(#'NO_PERMISSION'{completion_status=?COMPLETED_NO}); - SubobjKey -> + SubobjKey = corba:get_subobject_key(OE_THIS), + try begin + true = (byte_size(SubobjKey) < 20), + undefined = binary_to_term(SubobjKey) + end + of + _ -> + corba:raise(#'NO_PERMISSION'{completion_status=?COMPLETED_NO}) + catch + error:_ -> %% Not atom 'undefined', carry on... _DF = fun() -> case mnesia:wread({orber_CosNaming, SubobjKey}) of -- cgit v1.2.3