Lee said:
> Hi
>
> Whenever I use the gets() function, the gnu c compiler gives a
> warning that it is dangerous to use gets().
No, it's the linker that warns you, not the compiler.
> Is this due to the possibility of array overflow?
Yes.
> Is it correct that the program flow can be altered by giving some
> specific calculated inputs to gets()?
Yes.
> How could anyone do so once the executable binary have been generated?
By overwriting the stack, for example. On a typical machine, the program is
loaded from disk into memory before execution. During execution, it is
present in memory. And the thing about memory is that it can be overwritten
with new values.
> I have heard many of the security problems and other bugs are due to
> array overflows.
Quite.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)