diff options
author | Sverker Eriksson <[email protected]> | 2017-03-10 17:42:01 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-03-10 17:42:01 +0100 |
commit | 864b6a1452fd53a9c12fe80cda32db91d6943fac (patch) | |
tree | ecaf2230d036dd7aaad0994848083aac3bcd23df /lib/orber | |
parent | 5d9bb41114544c9205a8b8f26642bad8231e8d4e (diff) | |
download | otp-864b6a1452fd53a9c12fe80cda32db91d6943fac.tar.gz otp-864b6a1452fd53a9c12fe80cda32db91d6943fac.tar.bz2 otp-864b6a1452fd53a9c12fe80cda32db91d6943fac.zip |
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'.
Diffstat (limited to 'lib/orber')
-rw-r--r-- | lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl | 15 |
1 files changed, 10 insertions, 5 deletions
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 |