3 ms·
For anything that requires some minimal level of robustness, the best option is not to make the program crash when a string is too long to fit in a buffer. Thi
by clarry 13y ago
For anything that requires some minimal level of robustness, the best option is not to make the program crash when a string is too long to fit in a buffer. This is not a buffer overflow condition. This is not at all like Division By Zero.
EDIT: In your world the kernel could panic because someone tried to open() too long a filename. Or should the application trying to open the file crash instead? And an IRC server would crash because my client sent a message with 513 characters.
I would rather detect these conditions and do the right thing.