From 1b4791fd55f264a61b85ccb07b9eb115de816159 Mon Sep 17 00:00:00 2001 From: Andy Heninger <andyh@apache.org> Date: Thu, 17 Aug 2000 00:04:50 +0000 Subject: [PATCH] Fix error in growing of XMLBuffer from within ensureCapacity() Fixes crash pointed out by Simon Fell. git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@172354 13f79535-47bb-0310-9956-ffa450edef68 --- src/framework/XMLBuffer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/framework/XMLBuffer.cpp b/src/framework/XMLBuffer.cpp index f3a2e14f1..e1aa080df 100644 --- a/src/framework/XMLBuffer.cpp +++ b/src/framework/XMLBuffer.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.5 2000/08/17 00:04:50 andyh + * Fix error in growing of XMLBuffer from within ensureCapacity() + * Fixes crash pointed out by Simon Fell. + * * Revision 1.4 2000/05/15 22:31:11 andyh * Replace #include<memory.h> with <string.h> everywhere. * @@ -135,7 +139,7 @@ void XMLBuffer::insureCapacity(const unsigned int extraNeeded) return; // Oops, not enough room. Calc new capacity and allocate new buffer - const unsigned int newCap = (unsigned int)((fIndex + fCapacity) * 1.25); + const unsigned int newCap = (unsigned int)((fIndex + extraNeeded) * 1.25); XMLCh* newBuf = new XMLCh[newCap+1]; // Copy over the old stuff -- GitLab