4 ms·if dst and src in memcpy overlap, the result is UB. so there's your window of opportunity. well, you asked...by newobj 4y agoif dst and src in memcpy overlap, the result is UB. so there's your window of opportunity. well, you asked...mort96 4y agoHaha, you're right, it's technically allowed for memcpy to call malloc in that circumstance.Tor3 4y agomemcpy wouldn't, but memmove would. memcpy doesn't check for or care about overlaps (and therefore the result is unpredictable - it'll depend on the implementation)