If I were Apple:
1) All parsing of hostile input happens in micro VM's
2) Re-write as fast as possible the core in a memory safe language