New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Wed Apr 15 17:24:28 PDT 2015


Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.

5 new defect(s) introduced to LibreOffice found with Coverity Scan.
3 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 5 of 5 defect(s)


** CID 1294411:    (RESOURCE_LEAK)
/include/LibreOfficeKit/LibreOfficeKitInit.h: 199 in lok_init_2(const char *, const char *)()
/include/LibreOfficeKit/LibreOfficeKitInit.h: 203 in lok_init_2(const char *, const char *)()


________________________________________________________________________________________________________
*** CID 1294411:    (RESOURCE_LEAK)
/include/LibreOfficeKit/LibreOfficeKitInit.h: 199 in lok_init_2(const char *, const char *)()
193                 fprintf( stderr, "failed to find hook in library '%s'\n", imp_lib );
194                 _dlclose( dlhandle );
195                 free( imp_lib );
196                 return NULL;
197             }
198             free( imp_lib );
>>>     CID 1294411:    (RESOURCE_LEAK)
>>>     Variable "dlhandle" going out of scope leaks the storage it points to.
199             return pSym( install_path );
200         }
201     
202         free( imp_lib );
203         return pSym2( install_path, user_profile_path );
204     }
/include/LibreOfficeKit/LibreOfficeKitInit.h: 203 in lok_init_2(const char *, const char *)()
197             }
198             free( imp_lib );
199             return pSym( install_path );
200         }
201     
202         free( imp_lib );
>>>     CID 1294411:    (RESOURCE_LEAK)
>>>     Variable "dlhandle" going out of scope leaks the storage it points to.
203         return pSym2( install_path, user_profile_path );
204     }
205     
206     static
207     #ifdef __GNUC__
208     __attribute__((used))

** CID 1294410:  Control flow issues  (MISSING_BREAK)
/libreofficekit/source/gtk/lokdocview.cxx: 944 in LOKDocView_Impl::callbackImpl(LOKDocView_Impl::CallbackData *)()


________________________________________________________________________________________________________
*** CID 1294410:  Control flow issues  (MISSING_BREAK)
/libreofficekit/source/gtk/lokdocview.cxx: 944 in LOKDocView_Impl::callbackImpl(LOKDocView_Impl::CallbackData *)()
938         {
939             GError* pError = NULL;
940     #if GTK_CHECK_VERSION(2,14,0)
941             gtk_show_uri(NULL, pCallback->m_aPayload.c_str(), GDK_CURRENT_TIME, &pError);
942     #endif
943         }
>>>     CID 1294410:  Control flow issues  (MISSING_BREAK)
>>>     The above case falls through to this one.
944         case LOK_CALLBACK_STATE_CHANGED:
945         {
946             commandChanged(pCallback->m_aPayload);
947         }
948         break;
949         default:

** CID 1294409:    (FORWARD_NULL)
/sc/source/ui/view/gridwin3.cxx: 246 in ScGridWindow::GetDrawMapMode(bool)()
/sc/source/ui/view/gridwin3.cxx: 246 in ScGridWindow::GetDrawMapMode(bool)()
/sc/source/ui/view/gridwin3.cxx: 246 in ScGridWindow::GetDrawMapMode(bool)()


________________________________________________________________________________________________________
*** CID 1294409:    (FORWARD_NULL)
/sc/source/ui/view/gridwin3.cxx: 246 in ScGridWindow::GetDrawMapMode(bool)()
240         ScDocument* pDoc = pViewData->GetDocument();
241     
242         // FIXME this shouldn't be necessary once we change the entire Calc to
243         // work in the logic coordinates (ideally 100ths of mm - so that it is
244         // the same as editeng and drawinglayer), and get rid of all the
245         // SetMapMode's and other unneccessary fun we have with pixels
>>>     CID 1294409:    (FORWARD_NULL)
>>>     Comparing "pDoc" to null implies that "pDoc" might be null.
246         if (pDoc && pDoc->GetDrawLayer() && pDoc->GetDrawLayer()->isTiledRendering())
247         {
248             return pViewData->GetLogicMode();
249         }
250     
251         SCTAB nTab = pViewData->GetTabNo();
/sc/source/ui/view/gridwin3.cxx: 246 in ScGridWindow::GetDrawMapMode(bool)()
240         ScDocument* pDoc = pViewData->GetDocument();
241     
242         // FIXME this shouldn't be necessary once we change the entire Calc to
243         // work in the logic coordinates (ideally 100ths of mm - so that it is
244         // the same as editeng and drawinglayer), and get rid of all the
245         // SetMapMode's and other unneccessary fun we have with pixels
>>>     CID 1294409:    (FORWARD_NULL)
>>>     Comparing "pDoc" to null implies that "pDoc" might be null.
246         if (pDoc && pDoc->GetDrawLayer() && pDoc->GetDrawLayer()->isTiledRendering())
247         {
248             return pViewData->GetLogicMode();
249         }
250     
251         SCTAB nTab = pViewData->GetTabNo();
/sc/source/ui/view/gridwin3.cxx: 246 in ScGridWindow::GetDrawMapMode(bool)()
240         ScDocument* pDoc = pViewData->GetDocument();
241     
242         // FIXME this shouldn't be necessary once we change the entire Calc to
243         // work in the logic coordinates (ideally 100ths of mm - so that it is
244         // the same as editeng and drawinglayer), and get rid of all the
245         // SetMapMode's and other unneccessary fun we have with pixels
>>>     CID 1294409:    (FORWARD_NULL)
>>>     Comparing "pDoc" to null implies that "pDoc" might be null.
246         if (pDoc && pDoc->GetDrawLayer() && pDoc->GetDrawLayer()->isTiledRendering())
247         {
248             return pViewData->GetLogicMode();
249         }
250     
251         SCTAB nTab = pViewData->GetTabNo();

** CID 1294408:  Control flow issues  (DEADCODE)
/sw/source/core/unocore/unotbl.cxx: 529 in lcl_FindCornerTableBox(const SwTableLines &, bool)()


________________________________________________________________________________________________________
*** CID 1294408:  Control flow issues  (DEADCODE)
/sw/source/core/unocore/unotbl.cxx: 529 in lcl_FindCornerTableBox(const SwTableLines &, bool)()
523             assert(pLine);
524             const SwTableBoxes& rBoxes(pLine->GetTabBoxes());
525             assert(rBoxes.size() != 0);
526             const SwTableBox* pBox = i_bTopLeft ? rBoxes.front() : rBoxes.back();
527             assert(pBox);
528             if(!pBox)
>>>     CID 1294408:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "return NULL;".
529                 return nullptr;
530             if(pBox->GetSttNd())
531                 return pBox;
532             pLines = &pBox->GetTabLines();
533         }
534     }

** CID 1294407:  Incorrect expression  (COPY_PASTE_ERROR)
/sc/source/core/tool/compiler.cxx: 5037 in ScCompiler::HandleTableRef()()


________________________________________________________________________________________________________
*** CID 1294407:  Incorrect expression  (COPY_PASTE_ERROR)
/sc/source/core/tool/compiler.cxx: 5037 in ScCompiler::HandleTableRef()()
5031                                 aColRange = mpToken->GetDoubleRef()->toAbs( aPos);
5032                             }
5033                             break;
5034                         default:
5035                             ;   // nothing
5036                     }
>>>     CID 1294407:  Incorrect expression  (COPY_PASTE_ERROR)
>>>     "aStart" in "aColRange.aEnd.Row() != aDBRange.aStart.Row()" looks like a copy-paste error.
5037                     if (aColRange.aStart.Row() != aDBRange.aStart.Row() || aColRange.aEnd.Row() != aDBRange.aStart.Row())
5038                         aRange = ScRange( ScAddress::INITIALIZE_INVALID);
5039                     else
5040                     {
5041                         aColRange.aEnd.SetRow( aRange.aEnd.Row());
5042                         aRange = aRange.Intersection( aColRange);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/211?tab=overview

To manage Coverity Scan email notifications for "libreoffice at lists.freedesktop.org", click https://scan.coverity.com/subscriptions/edit?email=libreoffice%40lists.freedesktop.org&token=d6481d718a775246b2340f282ebe5939 .



More information about the LibreOffice mailing list