About 249,000 results
- Viewed 238k times240edited Sep 2, 2022 at 15:10
Why is gets() dangerous
The first internet worm (the Morris Internet Worm) escaped about 30 years ago (1988-11-02), and it used gets() and a buffer overflow as one of its methods of propagating from system to system. The basic problem is that the func...
char *gets(char *buffer){assert(buffer != 0);abort();return 0;}Given that your code will crash anyway, sooner or later, it is better to head the trouble off sooner rather than later. I'd be prepared to add an error message:
fputs("obsolete and dangerous function gets() called\n", stderr);Content Under CC-BY-SA license c - Why is the gets function so dangerous that it should not be …
Explore further
c - warning: the `gets' function is dangerous and should not be …
- Question & Answer
gets() is risky to use! - GeeksforGeeks
Warning: the gets function is Dangerous and should …
WEBSep 14, 2019 · The correct thing to do is to use the fgets function with the stdin file handle since you can limit the characters read from the user. …
- Estimated Reading Time: 4 mins
Why there is no "gets" function in C standard library?
- People also ask
C gets function - codingpointer.com
Why GCC does warn me when I using gets () function for …
[Solved] Why gets() function is dangerous to use in code
Why gets() function dangerous to use??? - C / C++
warning: the `gets' function is dangerous and should not be used.
Related searches for warning: the `gets' function is dangerous a…
- Some results have been removed