diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-09 10:49:39 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-04-24 01:38:28 -0700 |
commit | a2c89f80b374877376f6e80a3d7ce049e93d6b3a (patch) | |
tree | be4fa61c1b2f5f21f5fe817377ff275fe43582f4 | |
parent | ea109817c48816ba83ac74d523707a14d094b062 (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>
(cherry picked from commit 1e9c954ffb1bca7f07509331802dd4ac85a7b11b)
-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 c13a813d0a14..9f4231c8d0a1 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(); } |