* stack smashing
@ 2005-02-03 6:29 kaushal
0 siblings, 0 replies; only message in thread
From: kaushal @ 2005-02-03 6:29 UTC (permalink / raw)
To: linux-c-programming
Hello all,
I wanted to understand the stacksmashing work.I simply copied and run
the first example code-snippet from the ALEPH-ONE's paper on "smashing
the stack for fun and profit"(http://www.insecure.org/stf/smashstack.txt
).But it did not skip the instruction.I tried this on the linux -x86
machine.The code follows:
----------------------------------------------------------------------------
void function(int a, int b, int c) {
char buffer1[5];
char buffer2[10];
int *ret;
ret = buffer1 + 12;
(*ret) += 8;
}
void main() {
int x;
x = 0;
function(1,2,3);
x = 1;
printf("%d\n",x);
}
----------------------------------------------------------------------------
Can somebody throw light on this?
-liuser
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-02-03 6:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-03 6:29 stack smashing kaushal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).