@marcan the language has nothing to do. It's a piece of crap code plain and simple.
It would never have passed any cursory code review if it were a bit more open. The only reason it's widely demoted is because it's mandated by committees that don't care how it works
@javierg The language matters because segfaulting on invalid input only happens in memory unsafe languages. On a memory safe language you generally have to make a conscious decision about how to handle errors and unexpected situations.