In trdp_pdReceive() pExistingElement->dataSize is assigned from the messsges header. But it don't consider if it is a TSN messges with a different messges header structure. So for TSN messages total wrong size is assigned and causing problems later.
A sugestion for this function is to use a temporery header filled once with data from the received header, parsing the differnet types. This avoids mistakes when editing this funciton later on.
Possible fix
Need to honour compile-time flags, too.