Skip to content
Snippets Groups Projects
Commit 00a0d030 authored by Alberto Massari's avatar Alberto Massari
Browse files

insertElementAt was not checking if there was room for the new element (bug#24714)

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175422 13f79535-47bb-0310-9956-ffa450edef68
parent 8991a69e
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
/** /**
* $Log$ * $Log$
* Revision 1.8 2003/11/21 15:44:12 amassari
* insertElementAt was not checking if there was room for the new element (bug#24714)
*
* Revision 1.7 2003/05/29 13:26:44 knoaman * Revision 1.7 2003/05/29 13:26:44 knoaman
* Fix memory leak when using deprecated dom. * Fix memory leak when using deprecated dom.
* *
...@@ -221,6 +224,7 @@ insertElementAt(const TElem& toInsert, const unsigned int insertAt) ...@@ -221,6 +224,7 @@ insertElementAt(const TElem& toInsert, const unsigned int insertAt)
ThrowXML(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex); ThrowXML(ArrayIndexOutOfBoundsException, XMLExcepts::Vector_BadIndex);
// Make room for the newbie // Make room for the newbie
ensureExtraCapacity(1);
for (unsigned int index = fCurCount; index > insertAt; index--) for (unsigned int index = fCurCount; index > insertAt; index--)
fElemList[index] = fElemList[index-1]; fElemList[index] = fElemList[index-1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment