From 3b386467f2d4b2b96b7e697d9f5b133819f6180e Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 25 Aug 2020 00:01:03 +0200 Subject: tdf#135997: properly check loop condition It should break when any of iterators reaches end, not only when both. Introduced in commit 710a39414569995bd5a8631a948c939dc73bcef9. The crash dump from the bug report points to one of these lines; this is a blind fix, since I cannot reproduce myself. Change-Id: Ie7f6b827256cdb7061901dc9b2ae5ee8e0222a38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101162 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- cui/source/dialogs/cuicharmap.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cui/source/dialogs') diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 3f3651bce366..13d3c8e7658b 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -261,7 +261,7 @@ void SvxCharacterMap::updateRecentCharControl() { int i = 0; for ( std::deque< OUString >::iterator it = maRecentCharList.begin(), it2 = maRecentCharFontList.begin(); - it != maRecentCharList.end() || it2 != maRecentCharFontList.end(); + it != maRecentCharList.end() && it2 != maRecentCharFontList.end(); ++it, ++it2, i++) { m_aRecentCharView[i].SetText(*it); @@ -360,7 +360,7 @@ void SvxCharacterMap::updateFavCharControl() { int i = 0; for ( std::deque< OUString >::iterator it = maFavCharList.begin(), it2 = maFavCharFontList.begin(); - it != maFavCharList.end() || it2 != maFavCharFontList.end(); + it != maFavCharList.end() && it2 != maFavCharFontList.end(); ++it, ++it2, i++) { m_aFavCharView[i].SetText(*it); -- cgit