Something to add to your last paragraph. There may be a lot of rudimentary security vulnerabilities in code that you copy from the internet, like not checking arguments, NULL, return values, etc. which an attacker could exploit. Stack Overflow wrote about it here.
Sometimes I also find it hard to believe a particular rare condition in my code could ever happen but it's always possible. Which reminds me, I should stop using rand() in my code because it's not so random but it's the only thing that ships with C++ as far as I know. The GNU Scientific Library is chock full of better random number generators.
Something to add to your last paragraph. There may be a lot of rudimentary security vulnerabilities in code that you copy from the internet, like not checking arguments, NULL, return values, etc. which an attacker could exploit. Stack Overflow wrote about it here.
Sometimes I also find it hard to believe a particular rare condition in my code could ever happen but it's always possible. Which reminds me, I should stop using rand() in my code because it's not so random but it's the only thing that ships with C++ as far as I know. The GNU Scientific Library is chock full of better random number generators.
Good point, let me put a disclaimer.