Hi,
does anybody knows a compiler or tool that test memcpy's for correct size of arg1 and length(arg3) so that it fits and dont copy over the end of arg1 and cause a fault ?!
(arg1 points to a structure)
thanx
daniel
Hi,
does anybody knows a compiler or tool that test memcpy's for correct size of arg1 and length(arg3) so that it fits and dont copy over the end of arg1 and cause a fault ?!
(arg1 points to a structure)
thanx
daniel
void *memcpy( void *dest, const void *src, size_t count );
dest : New buffer
src : Buffer to copy from
count : Number of characters to copy
~~~~~~~~~~~~~~~~~~~~~~~~
The memcpy function copies count bytes of src to dest. If the source and destination overlap, this function does not ensure that the original source bytes in the overlapping region are copied before being overwritten. Use memmove to handle overlapping regions.
Daniel,
If you want to make sure that there are no memory leaks in your code and you want to be sure that you are manipulating memory correctly, you can use "Mpatrol". This is a free open-source library avaliable especially for those type of things. It works on Windows NT and most UNIX flavours.
Hope this helps,
Cheers.
1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!