Commit f5dc5cc6 authored by Vasil Velichkov's avatar Vasil Velichkov

aper: Fix decode of big unsigned integers on 32bit platforms

On i686 the long is 4 bytes and when converted to uint64_t some big
unsigned values get converted to very big negative values

See https://github.com/vlm/asn1c/issues/185#issuecomment-372546490
parent fec0acc0
......@@ -879,7 +879,7 @@ INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
value += ct->lower_bound;
if((specs && specs->field_unsigned)
? asn_uint642INTEGER(st, value)
? asn_uint642INTEGER(st, (unsigned long)value)
: asn_int642INTEGER(st, value))
ASN__DECODE_FAILED;
ASN_DEBUG("Got value %ld + low %ld",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment