>>1
Most standard library implementations have fairly extensive unit and regression test suites to catch bugs and make sure they never crop up again.
They've also had a lot of eyes looking at them and they've been scrutinized by various stake holders.
Many commercial compilers for various languages come with their standard library's source code available for review.
That's not to say the occasional bug doesn't make it through now and then, but it get's caught pretty quickly and fixed.
Unless you're using one of those shitty open source scripting languages. Like Ruby for example. Then you might as well just plain accept that the thing is full of security issues.