Re: why dosent buffer gets overflowed



raashid bhatt wrote:
On Aug 22, 3:31 am, James Kuyper <jameskuy...@xxxxxxxxxxx> wrote:
raashid bhatt wrote:
On Aug 21, 10:45 pm, Richard Heathfield <r...@xxxxxxxxxxxxxxx>
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"

What makes you think the buffer isn't being overflowed?
...
i am using a debugger to track EIP but its this program exits
nornally

So, why does that make you think that the buffer isn't being
overflowed?

i mean if buffer gets overflowed then EIP should contains my A's and

EIP is a register, it's unlikely to be full of As (or 0x41s).

as per as definition of EIP (pointer to code) which contains A's
should cause the program to crash

Since you have a debugger you might like to investigate exactly where those
extra 5 As end up, if anywhere, and what that memory would otherwise have
been used for. Then you can find out why your program doesn't crash.

--
Bartc

.



Relevant Pages

  • Re: QT, ctypes dll and SEG Faults
    ... The crash can occur because you pass a char* to your library. ... char* is not managed by your library but by Python. ... filename with a hard coded value it doesn't crash. ...
    (comp.lang.python)
  • Re: [PATCH RFC] ext3 data=guarded v5
    ... buffer onto a list of things that must be written before a commit. ... Another way to avoid exposing stale data after a crash is to wait until ... a workqueue where the real work of updating the on disk i_size is done. ... When we start tracking guarded buffers on a given inode, ...
    (Linux-Kernel)
  • std::vector<string*> crash...
    ... Could anyone tell me why this code crash? ... main(int argc, char** argv) ...
    (comp.lang.cpp)
  • Kernel crash in interrupt handler: nested interrupt breaks saved %eip?
    ... Recently I've got a server crash. ... So I think that an interrupt happened at that time, and %eip was broken ... Some time ago I was playing with home-written RTAI-like realtime kernel ...
    (Linux-Kernel)
  • Re: CByteBuffer implementation passed between modules
    ... In many cases you get a crash at delete because there is a copy happening ... the buffer. ... CByteBuffer a, b; ... a.Set(buf, 10); ...
    (microsoft.public.vc.mfc)