|
|
|
|
|
by lelanthran
44 days ago
|
|
> It was caused by memory allocator returning uninitialized memory and every memory safe language I know about does not allow this in best-practice code. TBH this would have happened if they used the same approach in any language, and wouldn't have happened if they used a different approach in C. They wrote their own allocator. That's the problem. If they didn't use their own allocator valgrind or sanitisers would have caught this. If they used this approach in any other language, like Java or C#, heartbleed would still have happened. |
|
Every language has a preferred way to deal with things. In C, it's raw pointers, which are very error prone. Other languages have something better. For example, if you were to implement custom allocator in C#, would you return raw pointer? Or maybe base array + offset pair? Of course not, you'd choose a Span or Memory, and those are not prone to buffer overruns.