Skip to content

Commit

Permalink
aper: Fix several encoding where need_eom=true
Browse files Browse the repository at this point in the history
  • Loading branch information
pespin authored and mouse07410 committed Jul 12, 2022
1 parent f2e1d20 commit 30219de
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion skeletons/INTEGER_aper.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
if(per_put_many_bits(po, buf, 8 * mayEncode))
ASN__ENCODE_FAILED;
buf += mayEncode;
if(need_eom && aper_put_length(po, -1, 0, 0)) ASN__ENCODE_FAILED;
if(need_eom && (aper_put_length(po, -1, 0, 0) < 0)) ASN__ENCODE_FAILED;
}

ASN__ENCODED_OK(er);
Expand Down
2 changes: 1 addition & 1 deletion skeletons/OCTET_STRING_aper.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
buf += maySave >> 3;
sizeinunits -= maySave;
assert(!(maySave & 0x07) || !sizeinunits);
if(need_eom && aper_put_length(po, -1, 0, 0))
if(need_eom && (aper_put_length(po, -1, 0, 0) < 0))
ASN__ENCODE_FAILED; /* End of Message length */
}

Expand Down
2 changes: 1 addition & 1 deletion skeletons/aper_opentype.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ aper_open_type_put(const asn_TYPE_descriptor_t *td,
if(per_put_many_bits(po, bptr, maySave * 8)) break;
bptr = (char *)bptr + maySave;
toGo -= maySave;
if(need_eom && aper_put_length(po, -1, 0, 0)) {
if(need_eom && (aper_put_length(po, -1, 0, 0) < 0)) {
FREEMEM(buf);
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion skeletons/constr_SEQUENCE_OF_aper.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ SEQUENCE_OF_encode_aper(const asn_TYPE_descriptor_t *td,
ASN__ENCODE_FAILED;
}

if(need_eom && aper_put_length(po, -1, 0, 0))
if(need_eom && (aper_put_length(po, -1, 0, 0) < 0))
ASN__ENCODE_FAILED; /* End of Message length */
}

Expand Down

0 comments on commit 30219de

Please sign in to comment.