[Libreoffice-commits] .: sw/source

Michael Meeks michael at kemper.freedesktop.org
Thu May 19 13:27:14 PDT 2011


 sw/source/filter/ww8/ww8par3.cxx |    2 +-
 sw/source/filter/ww8/ww8par6.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 21b559701bbc4bb8bef2ebd21dfe643807cf5801
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Thu May 19 21:24:49 2011 +0100

    avoid de-referencing null pointers and string length problem

diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index b11a84f..c09b626 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -509,7 +509,7 @@ WW8LSTInfo* WW8ListManager::GetLSTByListId( sal_uInt32 nIdLst ) const
 void lcl_CopyGreaterEight(String &rDest, String &rSrc,
     xub_StrLen nStart, xub_StrLen nLen = STRING_LEN)
 {
-    if (nLen == STRING_LEN)
+    if (nLen > rSrc.Len() || nLen == STRING_LEN)
         nLen = rSrc.Len();
     for (xub_StrLen nI = nStart; nI < nLen; ++nI)
     {
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index c491cc1..c4ea2f0 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4687,7 +4687,7 @@ void SwWW8ImplReader::Read_Border(sal_uInt16 , const sal_uInt8* , short nLen)
         if( pAktColl )
             nBorder = ::lcl_ReadBorders(bVer67, aBrcs, 0, pStyles);
         else
-            nBorder = ::lcl_ReadBorders(bVer67, aBrcs, pPlcxMan->GetPapPLCF());
+            nBorder = ::lcl_ReadBorders(bVer67, aBrcs, pPlcxMan ? pPlcxMan->GetPapPLCF() : NULL);
 
         if( nBorder )                                   // Border
         {


More information about the Libreoffice-commits mailing list