What is a potential risk of using the gets() function for reading strings in C?

  • It always returns NULL
  • It can lead to buffer overflow
  • It doesn't exist in C
  • It has a higher time complexity
The gets() function is risky because it does not perform bounds checking and can lead to buffer overflows, potentially exposing the program to security vulnerabilities.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *