Studying buffer overflows [maybe OT]
From: darko (darko@autistici.org)Date: 04/08/02
- Previous message: Valdis.Kletnieks@vt.edu: "Re: combinations of 4"
- Next in thread: circut: "Re: Studying buffer overflows [maybe OT]"
- Reply: circut: "Re: Studying buffer overflows [maybe OT]"
- Reply: Nasko Oskov: "Re: Studying buffer overflows [maybe OT]"
- Reply: Syzop: "Re: Studying buffer overflows [maybe OT]"
- Reply: Guillaume Morin: "Re: Studying buffer overflows [maybe OT]"
- Reply: Rafal Rajs: "Re: Studying buffer overflows [maybe OT]"
- Reply: Eric LeBlanc: "Re: Studying buffer overflows [maybe OT]"
- Reply: Jan Kluka: "Re: Studying buffer overflows [maybe OT]"
- Reply: SpaceWalker: "Re: Studying buffer overflows [maybe OT]"
- Reply: Matthew Kauffman: "Re: Studying buffer overflows [maybe OT]"
- Reply: brien mac: "Re: Studying buffer overflows [maybe OT]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: darko <darko@autistici.org> To: vuln-dev@securityfocus.com Date: Mon, 8 Apr 2002 23:21:01 +0200
Hi all,
I've started to study buffer overflows. I wrote the following code:
void f() {
char a[4];
int *b;
b = a + 0x8;
(*b) += 0x8;
}
main() {
int x;
x = 0;
f();
x = 1;
printf("%d\n", x);
}
I want, after the call to f(), the program jump to printf() so the value of x
should remain 0, not 1. I always get segmentation faults, bus errors, etc.
and never that fuc*ing "x = 0" !!
Tested on a Celeron 433, red hat 7.2, gcc 2.96.
byez
darko
- Previous message: Valdis.Kletnieks@vt.edu: "Re: combinations of 4"
- Next in thread: circut: "Re: Studying buffer overflows [maybe OT]"
- Reply: circut: "Re: Studying buffer overflows [maybe OT]"
- Reply: Nasko Oskov: "Re: Studying buffer overflows [maybe OT]"
- Reply: Syzop: "Re: Studying buffer overflows [maybe OT]"
- Reply: Guillaume Morin: "Re: Studying buffer overflows [maybe OT]"
- Reply: Rafal Rajs: "Re: Studying buffer overflows [maybe OT]"
- Reply: Eric LeBlanc: "Re: Studying buffer overflows [maybe OT]"
- Reply: Jan Kluka: "Re: Studying buffer overflows [maybe OT]"
- Reply: SpaceWalker: "Re: Studying buffer overflows [maybe OT]"
- Reply: Matthew Kauffman: "Re: Studying buffer overflows [maybe OT]"
- Reply: brien mac: "Re: Studying buffer overflows [maybe OT]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]