New Defects reported by Coverity Scan for LibreOffice

Caolán McNamara caolanm at redhat.com
Thu Nov 14 10:06:13 UTC 2019


On Thu, 2019-11-14 at 08:10 +0000, scan-admin at coverity.com wrote:
> Hi,
> 
> Please find the latest report on new defect(s) introduced to
> LibreOffice found with Coverity Scan.

The below is new since...

commit a3c7a8282ddd08c7ed4a15d23089d09e418f8fae
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Fri Nov 8 17:13:05 2019 +0100

    jsdialogs: apply .uno:Color and CharBackColor to floating text
frames

I'm not sure what the right fix should be.

> 2 new defect(s) introduced to LibreOffice found with Coverity Scan.
> 5 defect(s), reported by Coverity Scan earlier, were marked fixed in
> the recent build analyzed by Coverity Scan.
> 
> New defect(s) Reported-by: Coverity Scan
> Showing 2 of 2 defect(s)
> 
> 
> ** CID 1455691:  Null pointer dereferences  (REVERSE_INULL)
> /sw/source/uibase/shells/drwtxtex.cxx: 660 in
> SwDrawTextShell::Execute(SfxRequest &)()
> 
> 
> _____________________________________________________________________
> ___________________________________
> *** CID 1455691:  Null pointer dereferences  (REVERSE_INULL)
> /sw/source/uibase/shells/drwtxtex.cxx: 660 in
> SwDrawTextShell::Execute(SfxRequest &)()
> 654                 return;
> 655         }
> 656     
> 657         std::unique_ptr<SfxItemSet> pNewArgs = pNewAttrs-
> >Clone();
> 658         lcl_convertStringArguments(nSlot, pNewArgs);
> 659     
> > > >     CID 1455691:  Null pointer dereferences  (REVERSE_INULL)
> > > >     Null-checking "pNewAttrs" suggests that it may be null, but
> > > > it has already been dereferenced on all paths leading to the
> > > > check.
> 660         if(nEEWhich && pNewAttrs)
> 661         {
> 662             std::unique_ptr<SfxPoolItem> pNewItem(pNewArgs-
> >Get(nWhich).CloneSetWhich(nEEWhich));
> 663             pNewArgs->Put(*pNewItem);
> 664         }
> 665     
> 
> ** CID 1455690:    (FORWARD_NULL)
> /sw/source/uibase/shells/drwtxtex.cxx: 657 in
> SwDrawTextShell::Execute(SfxRequest &)()
> /sw/source/uibase/shells/drwtxtex.cxx: 657 in
> SwDrawTextShell::Execute(SfxRequest &)()
> /sw/source/uibase/shells/drwtxtex.cxx: 657 in
> SwDrawTextShell::Execute(SfxRequest &)()
> 
> 
> _____________________________________________________________________
> ___________________________________
> *** CID 1455690:    (FORWARD_NULL)
> /sw/source/uibase/shells/drwtxtex.cxx: 657 in
> SwDrawTextShell::Execute(SfxRequest &)()
> 651     
> 652             default:
> 653                 assert(false && "wrong dispatcher");
> 654                 return;
> 655         }
> 656     
> > > >     CID 1455690:    (FORWARD_NULL)
> > > >     Passing null pointer "pNewAttrs" to "Clone", which
> > > > dereferences it. (The dereference happens because this is a
> > > > virtual function call.)
> 657         std::unique_ptr<SfxItemSet> pNewArgs = pNewAttrs-
> >Clone();
> 658         lcl_convertStringArguments(nSlot, pNewArgs);
> 659     
> 660         if(nEEWhich && pNewAttrs)
> 661         {
> 662             std::unique_ptr<SfxPoolItem> pNewItem(pNewArgs-
> >Get(nWhich).CloneSetWhich(nEEWhich));
> /sw/source/uibase/shells/drwtxtex.cxx: 657 in
> SwDrawTextShell::Execute(SfxRequest &)()
> 651     
> 652             default:
> 653                 assert(false && "wrong dispatcher");
> 654                 return;
> 655         }
> 656     
> > > >     CID 1455690:    (FORWARD_NULL)
> > > >     Passing null pointer "pNewAttrs" to "Clone", which
> > > > dereferences it. (The dereference happens because this is a
> > > > virtual function call.)
> 657         std::unique_ptr<SfxItemSet> pNewArgs = pNewAttrs-
> >Clone();
> 658         lcl_convertStringArguments(nSlot, pNewArgs);
> 659     
> 660         if(nEEWhich && pNewAttrs)
> 661         {
> 662             std::unique_ptr<SfxPoolItem> pNewItem(pNewArgs-
> >Get(nWhich).CloneSetWhich(nEEWhich));
> /sw/source/uibase/shells/drwtxtex.cxx: 657 in
> SwDrawTextShell::Execute(SfxRequest &)()
> 651     
> 652             default:
> 653                 assert(false && "wrong dispatcher");
> 654                 return;
> 655         }
> 656     
> > > >     CID 1455690:    (FORWARD_NULL)
> > > >     Passing null pointer "pNewAttrs" to "Clone", which
> > > > dereferences it. (The dereference happens because this is a
> > > > virtual function call.)
> 657         std::unique_ptr<SfxItemSet> pNewArgs = pNewAttrs-
> >Clone();
> 658         lcl_convertStringArguments(nSlot, pNewArgs);
> 659     
> 660         if(nEEWhich && pNewAttrs)
> 661         {
> 662             std::unique_ptr<SfxPoolItem> pNewItem(pNewArgs-
> >Get(nWhich).CloneSetWhich(nEEWhich));



More information about the LibreOffice mailing list