jhelovuo / RustDDS

Rust implementation of Data Distribution Service
Apache License 2.0
319 stars 65 forks source link

Malformed locator triggers panic while the port field is being unwrapped #286

Closed squizz617 closed 1 year ago

squizz617 commented 1 year ago

Hi @jhelovuo , My fuzzer discovered another remotely reachable panic in version 0.8.3.

It happens due to the fact that RTPS defines Locator_t types as the following,

struct Locator_t {
 long kind;
 unsigned long port;
 octet address[16];
};

where port can "legitimately" have values larger than UDP v4 allows.

When parsing the value in locator.rs, the unwrap fails.

Thank you.

jhelovuo commented 1 year ago

Thank you, @squizz617 . We are a bit slow to respond due to the summer holiday season, but I can confirm that this is a genuine bug.

jhelovuo commented 1 year ago

Fixed in Release 0.8.4 .