How do you prevent buffer overflows in C?

Answer Posted / glibwaresoftsolutions

• Use bounds checking while working with arrays.
• Use safer functions like snprintf() instead of sprintf().

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The difference between printf and fprintf is ?

945


Differentiate fundamental data types and derived data types in C.

810


Why is c fast?

786


Explain how do you determine a file’s attributes?

801


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

782


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

1952


What is the scope of static variable in c?

715


What is clrscr in c?

879


What is the difference between a free-standing and a hosted environment?

891


What are valid operations on pointers?

928


What is getche() function?

808


Why can’t we compare structures?

1034


What is modeling?

815


What is wrong with this program statement?

779


How can I convert a number to a string?

825