How do you prevent buffer overflows in C?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1942


What is the difference between the = symbol and == symbol?

809


What are c preprocessors?

901


Explain b+ tree?

824


What does emoji p mean?

783


What is hungarian notation? Is it worthwhile?

943


What are the restrictions of a modulus operator?

838


Disadvantages of C language.

837


Why isnt any of this standardized in c?

831


What language is windows 1.0 written?

774


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

2742


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

806


What is function definition in c?

778


Explain about the constants which help in debugging?

1072


What is #define used for in c?

797