答案:
1、 pData = (MessageData *)(pMessageMap+ pContext-> m_ulTaskId);
此行没有对pContext-> m_ulTaskId进行判断,如果pContext-> m_ulTaskId大于pContext-> m_ulMessageMapSize,则可能造成数组访问越界,应该改为:
If(pContext-> m_ulTaskId > pContext-> m_ulMessageMapSize)
{
Return E_FAIL;
}
pData = (MessageData *)(pMessageMap+ pContext-> m_ulTaskId);
2、 Hr = pContext-> m_pCallback->HandleMessage(pData);语句操作前,没有对pContext-> m_pCallback指针做非空判断
应该改为:
If(NULL == pContext-> m_pCallback)
{
Return E_FAIL;
}
Hr = pContext-> m_pCallback->HandleMessage(pData);
阅读(231) | 评论(0) | 转发(0) |