Re:History's Worst Software Bugs (2005)
by rgbrenner on Saturday August 01, 2015 @12:20PM
(#9987586)
C11 is about 6 years newer than the article. So the article was accurate at the time it was written.
Re:History's Worst Software Bugs (2005)
by rlongstaff on Saturday August 01, 2015 @12:18PM
(#9987572)
... but what percentage of current C code is C11. More importantly, how much new code is written according to C11?
But gets() isn't just one unsafe function all of the classic string functions are totally unsafe, and most of their safer replacements are similarly bad. They do things like take buffer size and then will truncate strings and leave off the terminating zero. So then the next string function will blow up.
I think really when people manipulate strings in c/c++ they use the safe functions that come with frameworks.
gets was deprecated in C99 and removed in C11.