Resolves: rhbz#988104 crash on certain pptx

f41
Caolán McNamara 11 years ago
parent d67d39d8c5
commit a462ee7c25

@ -0,0 +1,36 @@
From 3750deae3e2d8fcf8bcf795fe327e1da370a2c4d Mon Sep 17 00:00:00 2001
From: Katarina Behrens <bubli@bubli.org>
Date: Fri, 13 Sep 2013 17:29:12 +0200
Subject: [PATCH] Avoid crash when a comment contains data, but no text
calling back() on empty vector results in undef behaviour
Crash originally reported here:
http://lists.freedesktop.org/archives/libreoffice/2013-September/055827.html
Change-Id: Ibefdc7e2495fc31d748c16fedd3cee5eb957bfa2
---
oox/source/ppt/presentationfragmenthandler.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 247b81b..826130c 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -323,8 +323,12 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst
//set comment chars for last comment on slide
SlideFragmentHandler* comment_handler =
dynamic_cast<SlideFragmentHandler*>(xCommentsFragmentHandler.get());
+ // some comments have no text -> set empty string as text to avoid
+ // crash (back() on empty vector is undefined) and losing other
+ // comment data that might be there (author, position, timestamp etc.)
pCommentsPersistPtr->getCommentsList().cmLst.back().setText(
- comment_handler->getCharVector().back() );
+ comment_handler->getCharVector().empty() ? "" :
+ comment_handler->getCharVector().back() );
pCommentsPersistPtr->getCommentAuthors().setValues(maAuthorList);
//insert all comments from commentsList
--
1.8.3.1

@ -257,6 +257,7 @@ Patch16: 0001-Resolves-fdo-48835-application-menu-for-LibreOffice.patch
Patch17: 0001-Make-charmap.cxx-compile-with-icu-4.4.patch Patch17: 0001-Make-charmap.cxx-compile-with-icu-4.4.patch
Patch18: 0001-Resolves-rhbz-1006850-crash-in-SwCommentRuler-GetCom.patch Patch18: 0001-Resolves-rhbz-1006850-crash-in-SwCommentRuler-GetCom.patch
Patch19: 0001-select-sheet-menu-as-a-right-click-popup-to-the-prev.patch Patch19: 0001-select-sheet-menu-as-a-right-click-popup-to-the-prev.patch
Patch20: 0001-Avoid-crash-when-a-comment-contains-data-but-no-text.patch
%define instdir %{_libdir} %define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice %define baseinstdir %{instdir}/libreoffice
@ -1008,6 +1009,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch17 -p1 -b .Make-charmap.cxx-compile-with-icu-4.4.patch %patch17 -p1 -b .Make-charmap.cxx-compile-with-icu-4.4.patch
%patch18 -p1 -b .rhbz-1006850-crash-in-SwCommentRuler-GetCom.patch %patch18 -p1 -b .rhbz-1006850-crash-in-SwCommentRuler-GetCom.patch
%patch19 -p1 -b .select-sheet-menu-as-a-right-click-popup-to-the-prev.patch %patch19 -p1 -b .select-sheet-menu-as-a-right-click-popup-to-the-prev.patch
%patch20 -p1 -b .Avoid-crash-when-a-comment-contains-data-but-no-text.patch
# TODO: check this # TODO: check this
# these are horribly incomplete--empty translations and copied english # these are horribly incomplete--empty translations and copied english
@ -2098,8 +2100,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif %endif
%changelog %changelog
* Fri Sep 13 2013 Caolán McNamara <caolanm@redhat.com> - 1:4.1.2.1-3.UNBUILT * Tue Sep 17 2013 Caolán McNamara <caolanm@redhat.com> - 1:4.1.2.1-3
- add select sheet menu to calc prev/next area - add select sheet menu to calc prev/next area
- Resolves: rhbz#988104 crash on certain pptx
* Thu Sep 12 2013 Caolán McNamara <caolanm@redhat.com> - 1:4.1.2.1-2 * Thu Sep 12 2013 Caolán McNamara <caolanm@redhat.com> - 1:4.1.2.1-2
- Resolves: rhbz#1006850 crash in SwCommentRuler - Resolves: rhbz#1006850 crash in SwCommentRuler

Loading…
Cancel
Save