Skip to content

Commit

Permalink
Fix decoding of APER
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse07410 committed Jun 20, 2024
1 parent 4d360ed commit 998e7ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions skeletons/aper_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ aper_get_constrained_whole_number(asn_per_data_t *pd, long lb, long ub) {

/* X.691 2002 10.5.7.2 - The one-octet case. */
if (range == 256) {
if (aper_get_align(pd))
if (aper_get_align(pd) < 0)
return -1;
value = per_get_few_bits(pd, 8);
if (value < 0 || value >= range)
Expand All @@ -150,7 +150,7 @@ aper_get_constrained_whole_number(asn_per_data_t *pd, long lb, long ub) {

/* X.691 2002 10.5.7.3 - The two-octet case. */
if (range <= 65536) {
if (aper_get_align(pd))
if (aper_get_align(pd) < 0)
return -1;
value = per_get_few_bits(pd, 16);
if (value < 0 || value >= range)
Expand All @@ -174,7 +174,7 @@ aper_get_constrained_whole_number(asn_per_data_t *pd, long lb, long ub) {
ASN_DEBUG("todo: aper_get_constrained_whole_number: value_len > 4");
return -1;
}
if (aper_get_align(pd))
if (aper_get_align(pd) < 0)
return -1;
value = per_get_few_bits(pd, value_len * 8);
if (value < 0 || value >= range)
Expand Down

0 comments on commit 998e7ea

Please sign in to comment.