[ATL] - Fix buffer overflow in CComDynamicUnkArray::Add. Found by Coverity (CID 2474)

[NDK] - Remove meaningless const attribute from pointer rvalues to make Coverity's life easier

svn path=/trunk/; revision=54401
This commit is contained in:
Thomas Faber 2011-11-16 21:17:38 +00:00
parent 022c6505d0
commit 6c0659ceac
3 changed files with 6 additions and 5 deletions

View file

@ -27,10 +27,10 @@ Author:
// KPCR Access for non-IA64 builds
//
#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS))
#define PCR ((KPCR * const)K0IPCR)
#define PCR ((KPCR *)K0IPCR)
#if defined(CONFIG_SMP) || defined(NT_BUILD)
#undef KeGetPcr
#define KeGetPcr() ((KPCR * const)__readfsdword(FIELD_OFFSET(KPCR, SelfPcr)))
#define KeGetPcr() ((KPCR *)__readfsdword(FIELD_OFFSET(KPCR, SelfPcr)))
#endif
//

View file

@ -128,7 +128,7 @@ typedef CCHAR KPROCESSOR_MODE;
//
// Dereferencable pointer to KUSER_SHARED_DATA in User-Mode
//
#define SharedUserData ((KUSER_SHARED_DATA *CONST)USER_SHARED_DATA)
#define SharedUserData ((KUSER_SHARED_DATA *)USER_SHARED_DATA)
//
// Maximum WOW64 Entries in KUSER_SHARED_DATA

View file

@ -849,9 +849,10 @@ public:
return 0;
m_ppUnk = newArray;
memset(&m_ppUnk[m_nSize], 0, (newSize - m_nSize) * sizeof(IUnknown *));
curCookie = m_nSize + 1;
m_nSize = newSize;
m_ppUnk[m_nSize] = pUnk;
return m_nSize + 1;
m_ppUnk[curCookie - 1] = pUnk;
return curCookie;
}
BOOL Remove(DWORD dwCookie)