Get the latest tech news
C can be memory safe
The idea of memory-safe languages is in the news lately. C/C++ is famous for being the world's system language (that runs most things) but ...
Once you give the programmer the ability to fix memory-safety problems like the solution above, you can then enable warnings for unsafe code. As the above function shows, the OpenSSL code is already somewhat memory safe, just based upon the flawed principle of relying upon diligent programmers. With such features, the gap is relative small, mostly just changing function parameter lists and data structures to link a pointer with its memory-bounds.
Or read this on Hacker News