Correctly allocate cb_crc_status for CRC.indication

Now allocates memory for `uint8_t* cb_crc_status` before pulling in unpack procedure.

Add utility functions related to CRC.indication.
Extra utility function to calculate allocated memory added.
This commit is contained in:
Rúben Soares Silva
2024-11-29 09:15:03 +01:00
committed by Robert Schmidt
parent aeac2b0df3
commit ff6e51879a
3 changed files with 106 additions and 0 deletions
+1
View File
@@ -4657,6 +4657,7 @@ uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t *value, uint8_t **ppReadPac
return 0;
}
if (value->num_cb != 0) {
value->cb_crc_status = calloc((value->num_cb / 8) + 1, sizeof(uint8_t));
if (!pullarray8(ppReadPackedMsg,
value->cb_crc_status,
(int)(value->num_cb / 8) + 1,