[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at suse.cz
Tue May 14 02:36:26 PDT 2013


 sw/source/core/doc/dbgoutsw.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1db501836805b3da00db699ddca892bf5635ccf5
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue May 14 11:35:41 2013 +0200

    Out of bounds substring access
    
    Change-Id: I96e2845a17db78345adfb7c3e9e0dea5dbbb0a6b

diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index ac36438..efd10b7 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -567,7 +567,7 @@ static String lcl_dbg_out(const SwNode & rNode)
         const SfxItemSet * pAttrSet = pTxtNode->GetpSwAttrSet();
 
         aTmpStr += String("<txt>", RTL_TEXTENCODING_ASCII_US);
-        aTmpStr += pTxtNode->GetTxt().copy(0, 10);
+        aTmpStr += pTxtNode->GetTxt().getLength() > 10 ? pTxtNode->GetTxt().copy(0, 10) : pTxtNode->GetTxt();
         aTmpStr += String("</txt>", RTL_TEXTENCODING_ASCII_US);
 
         if (rNode.IsTableNode())


More information about the Libreoffice-commits mailing list