What could possibly go wrong?
What could possibly go wrong?
https://www.postgresql.org/message-id/1689.1134422394@sss.pg...
If you're going to use Postgres as an example of writing secure code in a language, that's fine, but make sure you're advocating for this C variant and not for standard C. Standard C, where signed integer overflow is undefined and the strict aliasing rule exists, is extremely hard to write secure code in.
http://blog.regehr.org/archives/1307
(There's also the separate issue that most of the input paths into Postgres are trusted in some way: you don't expect malformed database files, and you often don't expect hostile queries. It's primarily the auth code that needs to be rock-solid, which is a relatively small piece of the software.)
I think we really should have "official" variants of C that are a bit more predictable. But I guess that's not happening.
https://www.openbsd.org/errata59.html (although of course OpenBSD is pretty decent generally)
https://www.cvedetails.com/vulnerability-list/vendor_id-6/Fr...
https://www.cvedetails.com/vulnerability-list/vendor_id-33/p...
https://www.cvedetails.com/vulnerability-list/vendor_id-336/...