Commit 30219de2 authored by Pau Espin Pedrol's avatar Pau Espin Pedrol Committed by Mouse

aper: Fix several encoding where need_eom=true

parent f2e1d207
......@@ -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);
......
......@@ -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 */
}
......
......@@ -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;
}
......
......@@ -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 */
}
......
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