Commit 41f7b98b authored by Vasil Velichkov's avatar Vasil Velichkov Committed by Mouse

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 fa5e1c5d
......@@ -883,7 +883,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