So, basically nothing in real world domain. The protections are basic at best. The most common errors are runtime exceptions, zero protection offered. YMMV.
The Heartbleed Bug[1] sure felt like a real world domain problem to me. If OpenSSL were written in a memory-safe language like Java it would not have happened.
I'm sure the OpenSSL devs could've figured out some obscene way of messing with the JVM to make it happen. You know just in case you needed to cross compile it for Windows 3.1 using VMS or something.
Well if you use sun.misc.unsafe or JNI all bets are off