Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > why dosent buffer gets overflowed

Reply
Thread Tools

why dosent buffer gets overflowed

 
 
cr88192
Guest
Posts: n/a
 
      08-26-2008

"raashid bhatt" <> wrote in message
news:df3ca2a0-4ad4-4e5e-84d4-...
On Aug 22, 3:31 am, James Kuyper <jameskuy...@verizon.net> wrote:
> raashid bhatt wrote:
> > On Aug 21, 10:45 pm, Richard Heathfield <r...@see.sig.invalid> wrote:
> >> raashid bhatt said:

>
> >>> #include <stdio.h>
> >>> #include <string.h>
> >>> #include <stdlib.h>
> >>> void func(char *p)
> >>> {
> >>> char i[5];
> >>> strcpy(i, p);
> >> Subject line: "why dosent buffer gets overflowed"

>


<snip>

> i mean if buffer gets overflowed then EIP should contains my A's and
> as per as definition of EIP (pointer to code) which contains A's
> should cause the program to crash


however...

you need to keep track of the memory layout as well, and although on x86
(implied by reference to EIP) the buffer may overflow and thrash the return
address, one needs to take into account certain things, like exactly how
much is on the stack, how the compiler has organized it, ...

now, as it so happens, you may well have only partially overwritten EBP
here, which will not change the return address, but it may (depending on
compiler and settings) crash if you try to use local variables...


of course, since these kinds of things usually have nefarious uses, I will
refrain from describing the details too much further...



 
Reply With Quote
 
 
 
 
cr88192
Guest
Posts: n/a
 
      08-26-2008

"William Pursell" <> wrote in message
news:f3d2a2a7-3c60-48c4-9e9c-...
>
> I think we've had this discussion enough on
> other threads, but gets() is always a potential
> source of buffer overflow.
>


or, alternatively:
"I wants it bigger buffer";
"why I take this it not gets bigger";
he takes more, and then overflows just prior to crashing...


> --
> William Pursell



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET "XSL processor stack has overflowed." Prabu ASP .Net 1 03-05-2007 08:23 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Detecting line wrap and adding "..." to overflowed words Jason HTML 3 10-14-2006 11:11 AM
Curl dosent in my c++ app dosent seem to be working in apache cgi dannyarcher@gmail.com C++ 1 11-01-2005 01:34 PM
img overflowed by text Rafal 'Raf256' Maj HTML 10 11-19-2003 11:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57