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.

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


Please Help Members By Posting Answers For Below Questions

What is the size of a union variable?

1053


Is it possible to have a function as a parameter in another function?

1081


Differentiate between calloc and malloc.

1273


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15816


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1859


What is the purpose of void pointer?

1036


Why we use break in c?

1014


swap 2 numbers without using third variable?

1135


What is difference between structure and union?

1134


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1077


What is malloc calloc and realloc in c?

1334


Explain the concept and use of type void.

1118


What do you know about the use of bit field?

1049


What is difference between static and global variable in c?

1058


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

1101