Definition
Plain language
A basic programming command that copies a chunk of data from one spot in a computer's memory to another.
As stated in the literature
The C standard-library function that copies a fixed number of bytes between memory regions; a frequent site of memory-safety vulnerabilities when the copy length exceeds the destination allocation, as in the heap-overflow and use-after-free race conditions found in Windows COM services.
Why it matters: It is a workhorse of everyday programming, but copying more data than the destination can hold is a classic source of security holes.
For example, a program uses memcpy to copy a block of received network data into a buffer it set aside for it.
Heard on the show
“Inside the linker, there's a function with a memcpy — that copies some number of bytes from one buffer to another.”Episode 014 — Why a Constrained Pipeline Beat a Full Coding Agent at Finding Bugs 30-to-1