Even if we rewrote #curl in rust, the just reported UAF RCE could still happen when integrating third party libraries like OpenSSL, nghttp2 and others.
Look at the linked source of ‚upki‘ the new lib for certificate validation. Most of the code is ‚unsafe‘ and memory pointers are stored in OpenSSL via „*_set_ex_data()“ beyond any guard of the rust compiler.
#curl used such an „ex_data“ pointer beyond its lifetime in the CVE. C or rust unsafe, makes no difference.
https://github.com/rustls/upki/blob/main/upki-openssl/src/lib.rs