[Libreoffice] Question about Possible null pointer dereference in SpellDialog.cxx (cui one)

David Tardon dtardon at redhat.com
Sun Sep 18 21:48:32 PDT 2011


On Fri, Sep 16, 2011 at 04:29:57PM -0700, julien2412 wrote:
> Hello,
> 
> cppcheck detected this on core/cui/source/dialogs/SpellDialog.cxx
> 1534	nullPointer	error	Possible null pointer dereference: pNewError
> 1538	nullPointer	error	Possible null pointer dereference: pNewError
> 1555	nullPointer	error	Possible null pointer dereference: pNewError
> 1559	nullPointer	error	Possible null pointer dereference: pNewError
> 1570	nullPointer	error	Possible null pointer dereference: pNewBack
> 1595	nullPointer	error	Possible null pointer dereference: pNewError
> 1751	nullPointer	error	Possible null pointer dereference: pNewBackground
> 
> I found that before the commit  d54c3ad1518e32938117c7e529dda375d4110888,
> most (all?) of these variables were initialized. For example like this :
> TextAttrib* pNewError =  pErrorAttrib->GetAttr().Clone();
> 
> I supposed there was certainly a good reason, but I don't know how can it
> works now. Of course, I wouldn't have noticed this without cppcheck report.

Hi, Thomas,

could you explain what that commit was supposed to fix?

D.


More information about the LibreOffice mailing list