Re: Avoiding Buffer Overflows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 8 Jan 2002, Trano wrote:
> #include <stdio.h>
>
> int
> main(int argc, char **argv)
> {
>          char buf[100];
>          strcpy(buf, argv[1]);
>          exit(1);
> }
Hi,

That code produces a "Segmentation fault (core dumped)"
with gcc version 2.96.

Also this one:

On Wed, 9 Jan 2002, Kenny Colliander wrote:
>#include <stdio.h>
>int main(int argc, char **argv)
>{
>         char buf[100+1]; // + NULL
>         strncpy(argv[1], buf, 100);
>         exit(1);
>}


Regards,

David Correa RHCE CCNA
http://www.linux-tech.com




------------------------------------------------------------------------
     To unsubscribe email security-discuss-request@linuxsecurity.com
         with "unsubscribe" in the subject of the message.


[Index of Archives]     [Fedora Announce]     [Linux Crypto]     [Kernel]     [Netfilter]     [Bugtraq]     [USB]     [Fedora Security]

  Powered by Linux