summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-09-18 10:47:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-09-18 22:19:31 +0200
commit5e381ffbe7069a454dc807113ab4058fad005c55 (patch)
tree97241ac6a588b3a3d867c8ae07ea37bb0aafa919 /sax
parent9d837f19d1bf4cfbdee528e027f5b72d9b1da73d (diff)
allow events to accumulate past limit if an exception is pending
Change-Id: Ic54c31961b887e06267aba1ceb0378508d24ded0 Reviewed-on: https://gerrit.libreoffice.org/42411 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/fastparser/fastparser.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 59dd995ce0f5..5281ca14920e 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -550,6 +550,13 @@ Event& Entity::getEvent( CallbackType aType )
return maSharedEvent;
EventList& rEventList = getEventList();
+ if (mnProducedEventsSize == rEventList.maEvents.size())
+ {
+ SAL_WARN_IF(!maSavedException.hasValue(), "sax",
+ "Event vector should only exceed " << mnEventListSize <<
+ " temporarily while an exception is pending");
+ rEventList.maEvents.resize(mnProducedEventsSize + 1);
+ }
Event& rEvent = rEventList.maEvents[mnProducedEventsSize++];
rEvent.maType = aType;
return rEvent;
@@ -927,7 +934,7 @@ void FastSaxParserImpl::produce( bool bForceFlush )
{
Entity& rEntity = getEntity();
if (bForceFlush ||
- rEntity.mnProducedEventsSize == Entity::mnEventListSize)
+ rEntity.mnProducedEventsSize >= Entity::mnEventListSize)
{
osl::ResettableMutexGuard aGuard(rEntity.maEventProtector);