Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async client segfaults if ssl options are not set #238

Open
Altair-Bueno opened this issue Oct 29, 2024 · 0 comments
Open

Async client segfaults if ssl options are not set #238

Altair-Bueno opened this issue Oct 29, 2024 · 0 comments

Comments

@Altair-Bueno
Copy link

Current behavior

Segfault for MQTT over TLS/TCP if SslOptions are unset.

Expected behavior

Memory safety guarantees. No invalid access.

Sample code

use paho_mqtt::async_client::AsyncClient;
use paho_mqtt::ssl_options;

#[tokio::main]
async fn main() {
    let client = paho_mqtt::CreateOptionsBuilder::new().finalize();
    let client = AsyncClient::new(client).unwrap();

    #[allow(unused)]
    let ssl_options = ssl_options::SslOptionsBuilder::new().finalize();
    let connect = paho_mqtt::ConnectOptionsBuilder::new()
        .server_uris(&["mqtts://test.mosquitto.org:8883"])
        //.ssl_options(ssl_options)
        .finalize();
    client.connect(connect).await.unwrap();
}

image

paho-mqtt-segfault-no-ssl-options.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant