News for hackers. Stuff that matters.
Re:Pointers and memory leaks in C by larssorenson on Friday October 10, 2014 @02:37PM (#8439344)

    char *name = (char *) malloc(11); 
    // Assign some value to name
    memcpy ( p,name,11); // Problem begins here
"In this example, the memcpy operation is trying to write 11 bytes to p, whereas it has been allocated only 10 bytes."

I'm sorry, but I see it as having malloc'd 11 bytes...

Re:Pointers and memory leaks in C by jibsen on Friday October 10, 2014 @02:51PM (#8439420)
The first parameter to memcpy is the destination.