AsyncClient::subscribe_many
has UB if topics.len() > qos.len()
#215
Labels
Milestone
AsyncClient::subscribe_many
has UB if topics.len() > qos.len()
#215
https://github.com/eclipse/paho.mqtt.rust/blob/cf953b937eaa66c436e746dcfde98d2bf61b36ac/src/async_client.rs#L878-L896
The Rust code passes in
topics.len()
as thecount
parameter ofMQTTAsync_subscribeMany
, which then assumes thatqos
also has the same number of elements. If the caller passes in a smaller slice ofqos
, then the C library will read past the end of the slice.Since the function is infallible, you could at least add an assert like:
The text was updated successfully, but these errors were encountered: