summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-09 10:49:39 +0000
committerDavid Tardon <dtardon@redhat.com>2018-02-09 16:35:39 +0100
commit1e9c954ffb1bca7f07509331802dd4ac85a7b11b (patch)
treed70b6fdff02cb78647cfc7e4873373e783498d47
parentecff2a84e2766dd93bd028e065d9ea3d833b369b (diff)
ofz#6173 check index before use
Change-Id: I09d15ab324af0a8b3566f11868eb3266a68c4afe Reviewed-on: https://gerrit.libreoffice.org/49499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sw/source/filter/ww8/ww8toolbar.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index d5d4857baf92..08332085c3e3 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -164,7 +164,9 @@ bool SwCTBWrapper::Read( SvStream& rS )
std::vector< sal_Int16 >::iterator it_end = dropDownMenuIndices.end();
for ( std::vector< sal_Int16 >::iterator it = dropDownMenuIndices.begin(); it != it_end; ++it )
{
- rCustomizations[ *it ].bIsDroppedMenuTB = true;
+ if (*it < 0 || static_cast<size_t>(*it) >= rCustomizations.size())
+ continue;
+ rCustomizations[*it].bIsDroppedMenuTB = true;
}
return rS.good();
}