Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi,

cppcheck said that
[impress/sd/source/ui/func/fusnapln.cxx:186]: (error) Possible null pointer dereference: pPV
which is, at a glance, worth noting.
It would be great if someone shows the de-referenceing has no problem,
otherwise the attached patch may provides a workaround.

Cheers,
-- Takeshi Abe
From 3a7de459bfa605503f6865a8e23b51b6ad3e2d3c Mon Sep 17 00:00:00 2001
From: Takeshi Abe <tabe@fixedpoint.jp>
Date: Sun, 16 Jan 2011 18:40:56 +0900
Subject: [PATCH] possible null-dereferencing found by cppcheck

---
 sd/source/ui/func/fusnapln.cxx |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx
index 72356ca..2f8eac7 100644
--- a/sd/source/ui/func/fusnapln.cxx
+++ b/sd/source/ui/func/fusnapln.cxx
@@ -179,11 +179,14 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
             }
         }
     }
+
+    if (pPV) {
     Point aHlpPos;
 
     aHlpPos.X() = ((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_X)).GetValue();
     aHlpPos.Y() = ((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_Y)).GetValue();
     pPV->PagePosToLogic(aHlpPos);
+    }
 
     if ( bCreateNew )
     {
-- 
1.7.2.3


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.