5 comments

[ 2.8 ms ] story [ 23.4 ms ] thread
Confucius say "man who write C have many holes in pants"

That's what our lead C dev says. And I agree, as a C programmer.

Always check your arithmetic, always check your arithmetic, always check your arithmetic...

No, let's just keep repeating old classic bugs.

OpenBSD's reallocarray(3) is a step in the right direction, but I've always been concerned about the focus on multiplication; needing to allocate x*y+z bytes is a rather common pattern. I suspect there's still plenty of additive arithmetic that goes unchecked.