We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The Erlang ASN.1 compiler generates code that crashes when it is invoked to decode REAL 0 values.
To Reproduce Use file RealTest.asn1 containing the following ASN.1 encoding:
RealTest.asn1
RealTest DEFINITIONS ::= BEGIN Real ::= REAL END
Compile the .asn1 file using the asn1ct module and use the decode function in the generated Erlang stub.
.asn1
asn1ct
decode
% erl Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace] Eshell V15.1.2 (press Ctrl+G to abort, type help(). for help) 1> asn1ct:compile('RealTest', []). ok 2> 'RealTest':decode('Real',[9,0]). {error,{asn1,{{badmatch,{0,<<>>}}, [{'RealTest',decode_real,1, [{file,"RealTest.erl"},{line,139}]}, {'RealTest',decode,2,[{file,"RealTest.erl"},{line,53}]}, {erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,904}]}, {shell,exprs,7,[{file,"shell.erl"},{line,893}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,849}]}, {shell,eval_loop,4,[{file,"shell.erl"},{line,834}]}]}}}
Expected behavior
'RealTest':decode('Real',[9,0]). should return {ok,0}
'RealTest':decode('Real',[9,0]).
{ok,0}
Affected versions OTP 27
Additional context Lev Walkin @vlm, the author of asn1c, reported a similar issue.
asn1c
This bug is caused by line 218 in asn1rtt_real_common.erl. I suggest a possible fix to change line 218 from
asn1rtt_real_common.erl
{0,Buffer};
to
{0,<<>>,0};
The text was updated successfully, but these errors were encountered:
bjorng
No branches or pull requests
Describe the bug
The Erlang ASN.1 compiler generates code that crashes when it is invoked to decode REAL 0 values.
To Reproduce
Use file
RealTest.asn1
containing the following ASN.1 encoding:Compile the
.asn1
file using theasn1ct
module and use thedecode
function in the generated Erlang stub.Expected behavior
'RealTest':decode('Real',[9,0]).
should return{ok,0}
Affected versions
OTP 27
Additional context
Lev Walkin @vlm, the author of
asn1c
, reported a similar issue.This bug is caused by line 218 in
asn1rtt_real_common.erl
. I suggest a possible fix to change line 218 fromto
The text was updated successfully, but these errors were encountered: