Skip to content

Conversation

@x2018
Copy link
Contributor

@x2018 x2018 commented Nov 9, 2025

In rustls_client_config_builder_build(), the config_builder is consumed via try_box_from_ptr!(builder) and ownership is transferred to Rust. Calling rustls_client_config_builder_free() afterwards would result in double-free.

An additional evidence is from the usage in rustls-ffi's test code at https://github.com/rustls/rustls-ffi/blob/main/librustls/tests/client.c#L431, where the builder is not freed and set to NULL after calling rustls_client_config_builder_build().

may need to further evaluate its security impact...

Other: backend->config is set if rustls_client_config_builder_build() is ok.

@github-actions github-actions bot added the TLS label Nov 9, 2025
@bagder
Copy link
Member

bagder commented Nov 10, 2025

/cc @cpu

Copy link
Contributor

@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you, good catch.

@bagder bagder closed this in 3f1a8db Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants