I recently stumbled across an article that claims Microsoft is banning the memcpy()
function in its secure programming shops. I understand the vulnerabilities i
If you're using older versions, like C99 or C++98, or on Solaris, you can't use memcpy_s, unless you have the Safe C library installed.
memcpy_s() is a Microsoft-specific implementation that doesn't exist on non-MS implementations, including ANSI, prior to C11, per their own standards.
I'll leave the pro-MS and anti-MS stuff aside, because it's irrelevant.
memmove() is a better solution anyway since it addressed the overlap issue. memmove_s() is more robust, but again, only if you're in C11 or later.