when you do maloc or new , space is allocated from heap segment of
your process address space.
Though you have alllocated (sizeof(struct abc) space but strcpy copies
"abcde" beyond your allocated space and overwrite the contents, we
should avoid this scenario and use strncpy so that it cannot go beyond
alloacted space.. you never know if some one using the buffer beyond
p.



On Mon, Aug 8, 2011 at 10:48 PM, Mohit Goel <[email protected]> wrote:
>
> @debabratas:   can u plz explain  this term ..heap corruption ..
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to