eclipse-cyclonedds / cyclonedds

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

dds_stream_normalize_data input must be writable #2109

Closed eboasson closed 1 month ago

eboasson commented 1 month ago

With the change of interpreting != 0 in CDR as true for a boolean, a call to dds_stream_normalize_data may now also modify the input when the endianness is native, if only for badly formed CDR. (See commit 615d5aae0004340dc5013fef6218276d51667e64)

For untrusted inputs we therefore no longer have the luxury of casting away the constness if we know there is no need to byteswap the input.

In regular operation, the only const inputs are those coming from IDLC and so, at least in principle, trustworthy. All untrustworthy stuff is dynamically allocated and not truly const. Where we do run into this is in fuzzing.