Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why is it usually a bad idea to use gets()? Suggest a workaround.



Why is it usually a bad idea to use gets()? Suggest a workaround...

Answer / hrpynux@gmail.com

The function gets() reads characters from the stdin and stores them at the provided input buffer. However, gets() will keep reading until it encounters a newline character. Unless the buffer is large enough, or the length of the line being read is known ahead of time, gets() can potentially overflow the input buffer and start overwriting memory it is not supposed to, wreaking havoc or opening security vulnerabilities.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

Write a program of prime number using recursion.

0 Answers   Aspiring Minds,


WHAT IS ABSTRACT DATA TYPE

4 Answers   Wipro,


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

0 Answers   HCL,


What is the difference between realloc() and free()

1 Answers  


f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?

7 Answers   Hughes,


What are run-time errors?

0 Answers  


Discuss the function of conditional operator, size of operator and comma operator with examples.

0 Answers   TCS,


Can we include one C program into another C program if yes how?

7 Answers   Infosys,


Which function in C can be used to append a string to another string?

0 Answers  


What is the difference between fread buffer() and fwrite buffer()?

0 Answers  


difference between loading and linking

1 Answers  


How can you access memory located at a certain address?

0 Answers  


Categories