If you are really worried about the security of old C code, then the safest, most portable thing to do is re-write in modern C++. This is sane and doable in a short period of time. Rust is not.
Oh no, no, no! Some people may reasonably, with some extreme care and diligence, maybe try to claim they can write safe and UB-free C code. If stars align properly. (See maybe SQLite. Seen as one of the pinnacles of crazy pedantism in C. Also, see the article about errors found recently in SQLite with fuzzing!) But with C++, it's just impossible for a human. It's too big, too quirky, too big, too wide, too deep, too…
Be sure to not use rm, bash, zsh, windows explorer right click + delete, etc. to delete these as that'd be relying on definitely broken software written in obsolete languages too!
On a more serious note: IF you knew C++ at all you'd really know better than to say things like these and I have no idea where did you get the information about UB, overwriting random memory or using exceptions (Qt is famous for using none at all for a good reason) being common in C++. And what people use is the sane subset. When was the last time you've seen outside of some obscure specific place any of: virtual or non public inheritance, pointers to members, switching [] operator arguments for C arrays, placement new, manually calling destructors, using templates or macros to do compile time programming, etc? Considering your ignorance of the fact you use tons of rock solid C++ software daily I'd think you don't know what most or all of these even are.
Rust fanboys like you who speak of C and C++ programmers like of idiots who write unsafe programs that endanger people is exactly why I'm not using Rust (yet?). If a community seems that toxic at a distance I'm not even going to try to come closer. It's even worse than Java or C# fanboys who seem to forget what their VMs are in because they are at least fanboying over HUGE enterprise proven languages. Rust on the other hand does have a few big projects (but Servo is a toy and few lines around hundreds of thousands of C++ in Firefox doesn't make it a Rust project) and looks more promising than D ever did but fanboys are acting like it's the next C++, Java, Julia and C# combined and grasping at straws "one package in choco is in Rust!", "easy to call C code!", ...