linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kaushal <kaushal@rocsys.com>
To: linux-c-programming@vger.kernel.org
Subject: stack smashing
Date: Thu, 03 Feb 2005 11:59:21 +0530	[thread overview]
Message-ID: <1107412160.5409.50.camel@localhost.localdomain> (raw)

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


                 reply	other threads:[~2005-02-03  6:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1107412160.5409.50.camel@localhost.localdomain \
    --to=kaushal@rocsys.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).