3 ms·
One gotcha it doesn't mention: don't rely on assertions for security-critical input checks. I sometimes see this sort of thing: char buf[200]; assert(f
by tlb 13y ago
One gotcha it doesn't mention: don't rely on assertions for security-critical input checks. I sometimes see this sort of thing:
char buf[200];
assert(foo_len < 200);
memcpy(buf, foo, foo_len);
But if asserts get turned off in a release build, it's suddenly vulnerable to buffer overflow attacks.