diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-09 10:49:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-09 22:02:41 +0100 |
commit | 017fcc2fcd00af17a97bd5463d89662404f57667 (patch) | |
tree | 9a3c5528a9a87eab52d64cf9b0f348d15a1167ac | |
parent | bbc4f9fee81656c618329cee088d9eedd9a1c457 (diff) |
ofz#6173 check index before use
Change-Id: I09d15ab324af0a8b3566f11868eb3266a68c4afe
Reviewed-on: https://gerrit.libreoffice.org/49486
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/filter/ww8/ww8toolbar.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index fbaf35979faf..b7dc69dc92bf 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(); } |