In tau_tti.c function ttiCreateCstInfoEntry
vehProp.prop from the received telegram is copied to an array of fixed size 1. Then length info is not considered and memory are not allocated.
This line cause the problem.
memcpy(pDest->pVehInfoList[idx].vehProp.prop, pData, pDest->pVehInfoList[idx].vehProp.len);
/ Application defined properties */
typedef struct
{
TRDP_SHORT_VERSION_T ver; /< properties version information, application defined /
UINT16 len; /< properties length in number of octets,
application defined, must be a multiple
of 4 octets for alignment reasons
value range: 0..32768 /
UINT8 prop[1]; /*< properties, application defined /
} TRDP_PROP_T;
Suggested solutions:
Change the defined size of prop to 32768 (Max value defined in IEC_61375-2-3_2015)
or
Change to a pointer and dynamically allocate the required memory from the length property.
Now for properties dynamic memory is allocated. ATTENTION: TRDP_VEHICLE_INFO_T and TRDP_CONSIST_INFO_T containing now a pointer to TRDP_PROP_T not anymore TRDP_PROP_T itself. To be tested.
Tested
Bug fixes committed in #2314
Test OK
Update #2316
Don't crate memory for properties if len = 0. And never access it.
Test OK
Memory for properties cstProp and vehProp dynamically allocated if len > 0. If len == 0, pxxxProp = NULL.