On 4/12/2011 8:24 AM, Wan Mohd Fairuz Wan Ismail wrote:
Hi,
I did a simple code to test out Overlapping |src| and |dst| pointers
in |memcpy |using memcheck. But it seems memcheck don't detect the src
and dst addresses are identical. Any idea?
CODE:
char* arr = malloc(10);
memcpy(arr, arr, 10);
free(arr);
This is correct; memcpy() does not perform this check. Look at the man
page for it and memmove().
--
David Chapman [email protected]
Chapman Consulting -- San Jose, CA
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users