5 ms·
Are there some details on whats wrong with these?
by zbendefy 6y ago
Are there some details on whats wrong with these?
- bvaldivielso 6y agoThe commit messages that added them explain the reasoning
- ufo 6y agoI wish they would have put that on comments instead of on the commit messages. It's not the first time that I've seen this particular list of banned functions being shared online and every time it happens someone has to explain that the most interesting info is hidden in the commit messages.
- alexchamberlain 6y agoAll the string functions have buffer overrun vulnerabilities if not used carefully. I'm not sure about the time functions though.
- edflsafoiewq 6y agoThe time functions are either non-reentrant, or, for the _r versions, have the same problem with buffer overruns. https://github.com/git/git/commit/1fbfdf556f2abc708183caca53ae4e2881b46ae2 https://github.com/git/git/commit/1fbfdf556f2abc708183caca53... https://github.com/git/git/commit/91aef030152d121f6b4bc3b933c696073ba073e2 https://github.com/git/git/commit/91aef030152d121f6b4bc3b933...
- trilinearnz 6y agoVery much this. I frequently write small games in C, and the number of times I have been bitten by baffling behaviour because a string somewhere was copied into an array that was too short, are many! Apart from that, I love the simplicity of the language and the stdlib, and it's definitely my preferred hobby programming environment. It would be good to know what the commonly-accepted alternatives are.
- deleted 6y ago[deleted]
- csours 6y agoI'm pretty sure you could google each of these with the word 'dangerous' For example: https://lgtm.com/rules/2154840805/ https://lgtm.com/rules/2154840805/