correctly use asn1c API: PDU pointers must be NULL when calling decoder

If the pointers are != NULL, asn1c assumes their memory has already been
allocated, rather than dynamically allocating storage for it.

Change-Id: I6b78be75d8927f032ca4051520a3053b3fbf9e13
This commit is contained in:
Harald Welte 2018-09-24 17:43:39 +02:00
parent 7b94dc231d
commit 9ebbacc801
2 changed files with 2 additions and 2 deletions

View File

@ -374,7 +374,7 @@ static int worker_transceive_loop(struct bankd_worker *worker)
uint8_t buf[65536]; /* maximum length expressed in 16bit length field */
asn_dec_rval_t rval;
int data_len, rc;
RsproPDU_t *pdu;
RsproPDU_t *pdu = NULL;
/* 1) blocking read of entire IPA message from the socket */
rc = blocking_ipa_read(worker->client.fd, buf, sizeof(buf));

View File

@ -51,7 +51,7 @@ struct msgb *rspro_enc_msg(RsproPDU_t *pdu)
/* consumes 'msg' _if_ it is successful */
RsproPDU_t *rspro_dec_msg(struct msgb *msg)
{
RsproPDU_t *pdu;
RsproPDU_t *pdu = NULL;
asn_dec_rval_t rval;
printf("decoding %s\n", msgb_hexdump(msg));