[Libreoffice-commits] .: sw/source
Norbert Thiebaud
nthiebaud at kemper.freedesktop.org
Tue Jun 12 06:39:02 PDT 2012
sw/source/core/draw/dcontact.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit d10305bbcf98088ef3d7eeee2299e4a21de6e48f
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Jun 12 08:38:11 2012 -0500
fix null pointer dereference
Change-Id: Ia117e1db43b29eda2f87bf1b1f26d580006e4b8b
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 998b167..a2e8e04 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1320,6 +1320,13 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
// get instance <SwAnchoredDrawObject> only once
const SwAnchoredDrawObject* pAnchoredDrawObj =
static_cast<const SwAnchoredDrawObject*>( GetAnchoredObj( &rObj ) );
+
+ /* protect against NULL pointer dereferencing */
+ if(!pAnchoredDrawObj)
+ {
+ break;
+ }
+
// OD 2004-04-06 #i26791# - adjust positioning and alignment attributes,
// if positioning of drawing object isn't in progress.
// #i53320# - no adjust of positioning attributes,
@@ -1432,8 +1439,11 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
// of as-character anchored object
if ( bAnchoredAsChar )
{
- const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
- ->AnchorFrm()->Prepare( PREP_FLY_ATTR_CHG, GetFmt() );
+ SwFrm* pAnchorFrm = const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)->AnchorFrm();
+ if(pAnchorFrm)
+ {
+ pAnchorFrm->Prepare( PREP_FLY_ATTR_CHG, GetFmt() );
+ }
}
}
}
More information about the Libreoffice-commits
mailing list