projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea13a8e
)
[ATL] Do not corrupt the internal state of the CSimpleArray when allocation fails...
author
Mark Jansen
<mark.jansen@reactos.org>
Sat, 17 Sep 2016 17:54:16 +0000
(17:54 +0000)
committer
Mark Jansen
<mark.jansen@reactos.org>
Sat, 17 Sep 2016 17:54:16 +0000
(17:54 +0000)
svn path=/trunk/; revision=72705
reactos/sdk/lib/atl/atlsimpcoll.h
patch
|
blob
|
history
diff --git
a/reactos/sdk/lib/atl/atlsimpcoll.h
b/reactos/sdk/lib/atl/atlsimpcoll.h
index
9564e53
..
3bf39c8
100644
(file)
--- a/
reactos/sdk/lib/atl/atlsimpcoll.h
+++ b/
reactos/sdk/lib/atl/atlsimpcoll.h
@@
-182,16
+182,17
@@
public:
{
RemoveAll();
-
m_nCapacity
= src.GetSize();
+
int nNewCount
= src.GetSize();
- T *pNewData = (T *)realloc(m_pData,
m_nCapacity
* sizeof(T));
+ T *pNewData = (T *)realloc(m_pData,
nNewCount
* sizeof(T));
ATLASSERT(pNewData);
if (pNewData == NULL)
return *this; // failure
- // store new
data and capacity
+ // store new
m_pData = pNewData;
- m_nCount = m_nCapacity;
+ m_nCount = nNewCount;
+ m_nCapacity = nNewCount;
}
else
{