Skip to content

Commit

Permalink
aper: Fix decode of big unsigned integers on 32bit platforms
Browse files Browse the repository at this point in the history
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 vlm#185 (comment)
  • Loading branch information
velichkov committed Mar 14, 2018
1 parent fec0acc commit f5dc5cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skeletons/INTEGER.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f5dc5cc

Please sign in to comment.