eclipse-cyclonedds / cyclonedds

Eclipse Cyclone DDS project
https://projects.eclipse.org/projects/iot.cyclonedds
Other
854 stars 352 forks source link

Segmentation fault occurs when sequence array element is undefined or partially defined #1994

Open Orbuild opened 4 months ago

Orbuild commented 4 months ago
eboasson commented 4 months ago

Yes, in general samples that you pass into the API need to be valid. That means:

Maybe I forgot something, maybe not 😂 I'm sure you understand. That exception noted above about sequences exists so you can memset everything 0 and you'll be good for read and take.

There are few functions that only care about the values of the key fields, for example dds_dispose. Those ignore all other fields, so in your example, you can call dds_dispose with id set correctly and everything else garbage.