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, ...@@ -297,7 +297,7 @@ INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
if(per_put_many_bits(po, buf, 8 * mayEncode)) if(per_put_many_bits(po, buf, 8 * mayEncode))
ASN__ENCODE_FAILED; ASN__ENCODE_FAILED;
buf += mayEncode; 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); ASN__ENCODED_OK(er);
......
...@@ -404,7 +404,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td, ...@@ -404,7 +404,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
buf += maySave >> 3; buf += maySave >> 3;
sizeinunits -= maySave; sizeinunits -= maySave;
assert(!(maySave & 0x07) || !sizeinunits); 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 */ ASN__ENCODE_FAILED; /* End of Message length */
} }
......
...@@ -106,7 +106,7 @@ aper_open_type_put(const asn_TYPE_descriptor_t *td, ...@@ -106,7 +106,7 @@ aper_open_type_put(const asn_TYPE_descriptor_t *td,
if(per_put_many_bits(po, bptr, maySave * 8)) break; if(per_put_many_bits(po, bptr, maySave * 8)) break;
bptr = (char *)bptr + maySave; bptr = (char *)bptr + maySave;
toGo -= 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); FREEMEM(buf);
return -1; return -1;
} }
......
...@@ -79,7 +79,7 @@ SEQUENCE_OF_encode_aper(const asn_TYPE_descriptor_t *td, ...@@ -79,7 +79,7 @@ SEQUENCE_OF_encode_aper(const asn_TYPE_descriptor_t *td,
ASN__ENCODE_FAILED; 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 */ 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