> #include <stdio.h>
>
> void example()
> {
> char a[10];
> char b[10];
> strcpy(a, "123456789");
> printf ("a: %s\n", a);
> b[20]='X';
> b[21]='Y';
> b[22]='Z';
> printf("a: %s\n", a);
> return;
> }
> main()
> {
> example();
> }
Ralf,
i ran this code
very interesting results, how? i would assume that the b buffer would
sit on the stack past the a buffer as it was declared afterward, and
also i'm confused of how assigning string lits to b beyond it's
allocation would affect a? and wouldn't a still have a term null char?
obviously this is the problem everyone speaks of, is there a logical
explanation?
thanks,
steve- Re[2]: protection against buffer overflows [EMAIL PROTECTED]
- Re: Re[2]: protection against buffer overflows Gergely Trifonov
- Re: protection against buffer overflows Rolf Kutz
- Re: Re[2]: protection against buffer overflows Alvin Oga
- Re: Re[2]: protection against buffer overflows Alexander Clouter
- RE: protection against buffer overflows Steve Johnson
- RE: protection against buffer overflows Alvin Oga
- RE: protection against buffer overflows Emmanuel Valliet
- Re: protection against buffer overflows Alan James
- Re: protection against buffer overflows Ralf Dreibrodt
- Re: protection against buffer overflows Steve Johnson
- Re: protection against buffer overflows Alvin Oga
- Re: protection against buffer overflows Preben Randhol
- Re: protection against buffer overflows Preben Randhol
- Re: protection against buffer overflows Vincent

