未验证 提交 d42ac98e 编写于 作者: O Omair Majid 提交者: GitHub

Use memmove instead of memcpy for overlapping copy (#47468)

memcpy is defined to only work when the source and destination memory
regions do not overlap. In here, they do. So let's use memmove instead.
上级 7eb29b4b
......@@ -444,7 +444,7 @@ public:
if (cmp == 0)
{
delete (*mid);
memcpy(mid,mid+1,(BYTE*)&m_Arr[m_ulOffset+m_ulCount]-(BYTE*)mid-1);
memmove(mid,mid+1,(BYTE*)&m_Arr[m_ulOffset+m_ulCount]-(BYTE*)mid-1);
m_ulCount--;
return TRUE;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册