summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-05-19 21:24:49 +0100
committerMichael Meeks <michael.meeks@novell.com>2011-05-19 21:26:11 +0100
commit21b559701bbc4bb8bef2ebd21dfe643807cf5801 (patch)
tree01e09d9b5449442d5c728a5ec0ac5a991092b7d9
parent337615300a13cc94a056cd0d842e87d8558f9e39 (diff)
avoid de-referencing null pointers and string length problemfeature/gsoc2011_wizards
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index b11a84fe3b..c09b6261da 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 c491cc193a..c4ea2f0fbb 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
{