1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 13:05:22 +02:00

[221601][dstore] xmlparser needs to be able to handle very large attributes

This commit is contained in:
David McKnight 2008-03-05 22:14:05 +00:00
parent 7f08921789
commit 11d34bf0e6

View file

@ -13,6 +13,7 @@
* *
* Contributors: * Contributors:
* David McKnight (IBM) [220123][dstore] Configurable timeout on irresponsiveness * David McKnight (IBM) [220123][dstore] Configurable timeout on irresponsiveness
* David McKnight (IBM) [221601][dstore] xmlparser needs to be able to handle very large attributes
*******************************************************************************/ *******************************************************************************/
package org.eclipse.dstore.internal.core.util; package org.eclipse.dstore.internal.core.util;
@ -395,12 +396,18 @@ public class XMLparser
default: default:
break; break;
} }
if (offset >= _maxBuffer) if (offset >= _maxBuffer)
{ {
done = true; int newMaxBuffer = 2 * _maxBuffer;
byte[] newBuffer = new byte[newMaxBuffer];
for (int i = 0; i < _maxBuffer; i++){
newBuffer[i] = _byteBuffer[i];
}
_maxBuffer = newMaxBuffer;
_byteBuffer = newBuffer;
} }
_byteBuffer[offset] = aByte; _byteBuffer[offset] = aByte;
offset++; offset++;
} }