vfork is better than fork/exec with overcommit.
It's interesting to me that you mention portability as an argument for why an out of memory situation should cause a crash rather than be handled like any other error.
Let's say I make a library and I want this library to be maximally portable. That means it should run in some of the following environments:
* Microsoft Windows
* embedded software
* operating system kernels
* drivers
* real-time software
In all of these environments, a library that handles out of memory correctly would be more portable than a library that panics.
If only there was a programming language that helped programmers solve this problem, while preventing the pitfalls that result in these security vulnerabilities that you mention...