diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-09 10:49:39 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-06 15:21:20 +0100 |
commit | 733e6028545c1a2c164979ec12538700b35dad66 (patch) | |
tree | 6fb942cda72976eb7fe8c5c9a6cfe6f606cba4ae | |
parent | check O_head size (diff) | |
download | core-733e6028545c1a2c164979ec12538700b35dad66.tar.gz core-733e6028545c1a2c164979ec12538700b35dad66.zip |
ofz#6173 check index before use
Change-Id: I09d15ab324af0a8b3566f11868eb3266a68c4afe
Reviewed-on: https://gerrit.libreoffice.org/49500
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit e355d7d691cfe9719b06e15129d86ec22a2bd7a4)
-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 0b6ddcd8ebb6..1dd7c8868d9d 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -167,7 +167,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(); } |