How do you prevent buffer overflows in C?



How do you prevent buffer overflows in C?..

Answer / nashiinformaticssolutions

• 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

More C Interview Questions

Why cant I open a file by its explicit path?

0 Answers  


struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??

9 Answers   Verifone,


Difference between MAC vs. IP Addressing

0 Answers  


Why is main function so important?

0 Answers  


Write an algorithm for a program that receives an integer as input and outputs the product of of its digits. E.g. 1234 = 24, 705 = 0

4 Answers  






Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL

0 Answers  


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

0 Answers  


What are the types of macro formats?

0 Answers  


What is the mean of this statement:: if(int i=0 * i=9)

2 Answers   HCL,


What are the general description for loop statement and available loop types in c?

0 Answers  


program to find which character is occured more times in a string and how many times it has occured? for example in the sentence "i love india" the output should be i & 3.

3 Answers  


while initialization of two dimensional arrays we can initialize like a[][2] but why not a[2][] is there any reason behind this?

4 Answers   Aptech,


Categories