Unverified Commit d57abfb6 authored by Mouse's avatar Mouse Committed by GitHub

Merge pull request #145 from v0-e/jer-null-fix

jer: Fix NULL
parents 37514256 649e70e1
...@@ -17,29 +17,29 @@ NULL_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, ...@@ -17,29 +17,29 @@ NULL_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
(void)sptr; (void)sptr;
(void)ilevel; (void)ilevel;
(void)flags; (void)flags;
(void)cb;
(void)app_key;
/* XMLNullValue is empty */ ASN__CALLBACK("null", 4);
er.encoded = 0;
ASN__ENCODED_OK(er); ASN__ENCODED_OK(er);
cb_failed:
ASN__ENCODE_FAILED;
} }
static enum jer_pbd_rval static enum jer_pbd_rval
NULL__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr, NULL__jer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
const void *chunk_buf, size_t chunk_size) { const void *chunk_buf, size_t chunk_size) {
(void)td; (void)td;
(void)sptr; (void)sptr;
(void)chunk_buf; /* Going to be empty according to the rules below. */
/* const char *p = (const char *)chunk_buf;
* There must be no content in self-terminating <NULL/> tag.
*/ if(chunk_size && p[0] == 'n' /* 'null' */) {
if(chunk_size)
return JPBD_BROKEN_ENCODING;
else
return JPBD_BODY_CONSUMED; return JPBD_BODY_CONSUMED;
} else {
return JPBD_BROKEN_ENCODING;
}
} }
asn_dec_rval_t asn_dec_rval_t
......
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