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-22 23:14:02 -0700 |
commit | 835e085d94b42048eff51299af5d199be83befb4 (patch) | |
tree | 18652eb378d1027a11d47b4d1ac9e4da11d66575 | |
parent | 2c73895d8d5f89ad19d55ef75f52a620390b7523 (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 2a742925dcd0..8d0ab881a8cf 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -166,7 +166,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(); } |