[Libreoffice] [Review] simple bugfix (too simple ?)

Lionel Elie Mamane lionel at mamane.lu
Sun Sep 11 15:41:11 PDT 2011


On Sun, Sep 11, 2011 at 10:53:45PM +0200, Julien Nabet wrote:

> Cppcheck detected this :
> core/jvmfwk/source/elements.cxx
> 127    assignBoolToPointer    error    Assigning bool value to
> pointer (converting bool value to address)

> Here is a simple patch :


> Too simple to be true ? I prefer asking instead of having missed a
> "special C++ trick".

Looks good to me. Commit!

(The incorrect code did not lead to any actual bug because the
function is only called with a pointer to a bool of value false and
the setting to true happened nicely with dereference; obviously, it
was a bug waiting to happen as soon as some code somewhere calls the
function with a pointer to a true bool...)

-- 
Lionel


More information about the LibreOffice mailing list