New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Thu Jan 27 02:26:26 UTC 2022
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
6 new defect(s) introduced to LibreOffice found with Coverity Scan.
1 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 6 of 6 defect(s)
** CID 1497861: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1497861: Null pointer dereferences (FORWARD_NULL)
/vcl/unx/gtk3/gtkinst.cxx: 6199 in <unnamed>::GtkInstanceWindow::change_default_widget(weld::Widget *, weld::Widget *)()
6193 GtkWidget* pWidgetOld = pGtkOld->getWidget();
6194 g_object_set(G_OBJECT(pWidgetOld), "has-default", false, nullptr);
6195 }
6196 if (pNew)
6197 {
6198 GtkInstanceWidget* pGtkNew = dynamic_cast<GtkInstanceWidget*>(pNew);
>>> CID 1497861: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pGtkNew" to "getWidget", which dereferences it.
6199 GtkWidget* pWidgetNew = pGtkNew->getWidget();
6200 g_object_set(G_OBJECT(pWidgetNew), "has-default", true, nullptr);
6201 }
6202 #endif
6203 }
6204
** CID 1497860: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1497860: Null pointer dereferences (FORWARD_NULL)
/vcl/source/app/salvtables.cxx: 1519 in SalInstanceWindow::change_default_widget(weld::Widget *, weld::Widget *)()
1513 SalInstanceWidget* pVclOld = dynamic_cast<SalInstanceWidget*>(pOld);
1514 pVclOld->getWidget()->set_property("has-default", OUString::boolean(false));
1515 }
1516 if (pNew)
1517 {
1518 SalInstanceWidget* pVclNew = dynamic_cast<SalInstanceWidget*>(pNew);
>>> CID 1497860: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pVclNew" to "getWidget", which dereferences it.
1519 pVclNew->getWidget()->set_property("has-default", OUString::boolean(true));
1520 }
1521 }
1522
1523 bool SalInstanceWindow::is_default_widget(const weld::Widget* pCandidate) const
1524 {
** CID 1497859: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1497859: Null pointer dereferences (FORWARD_NULL)
/vcl/source/app/salvtables.cxx: 1526 in SalInstanceWindow::is_default_widget(const weld::Widget *) const()
1520 }
1521 }
1522
1523 bool SalInstanceWindow::is_default_widget(const weld::Widget* pCandidate) const
1524 {
1525 const SalInstanceWidget* pVclCandidate = dynamic_cast<const SalInstanceWidget*>(pCandidate);
>>> CID 1497859: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pVclCandidate" to "getWidget", which dereferences it.
1526 return pVclCandidate->getWidget()->GetStyle() & WB_DEFBUTTON;
1527 }
1528
1529 void SalInstanceWindow::set_window_state(const OString& rStr)
1530 {
1531 SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(m_xWindow.get());
** CID 1497858: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1497858: Null pointer dereferences (FORWARD_NULL)
/vcl/unx/gtk3/gtkinst.cxx: 6193 in <unnamed>::GtkInstanceWindow::change_default_widget(weld::Widget *, weld::Widget *)()
6187 #else
6188 if (!pOld)
6189 recursively_unset_default_buttons();
6190 else
6191 {
6192 GtkInstanceWidget* pGtkOld = dynamic_cast<GtkInstanceWidget*>(pOld);
>>> CID 1497858: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pGtkOld" to "getWidget", which dereferences it.
6193 GtkWidget* pWidgetOld = pGtkOld->getWidget();
6194 g_object_set(G_OBJECT(pWidgetOld), "has-default", false, nullptr);
6195 }
6196 if (pNew)
6197 {
6198 GtkInstanceWidget* pGtkNew = dynamic_cast<GtkInstanceWidget*>(pNew);
** CID 1497857: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1497857: Null pointer dereferences (FORWARD_NULL)
/vcl/source/app/salvtables.cxx: 1514 in SalInstanceWindow::change_default_widget(weld::Widget *, weld::Widget *)()
1508 {
1509 if (!pOld)
1510 recursively_unset_default_buttons();
1511 else
1512 {
1513 SalInstanceWidget* pVclOld = dynamic_cast<SalInstanceWidget*>(pOld);
>>> CID 1497857: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pVclOld" to "getWidget", which dereferences it.
1514 pVclOld->getWidget()->set_property("has-default", OUString::boolean(false));
1515 }
1516 if (pNew)
1517 {
1518 SalInstanceWidget* pVclNew = dynamic_cast<SalInstanceWidget*>(pNew);
1519 pVclNew->getWidget()->set_property("has-default", OUString::boolean(true));
** CID 1497856: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1497856: Null pointer dereferences (FORWARD_NULL)
/vcl/unx/gtk3/gtkinst.cxx: 6208 in <unnamed>::GtkInstanceWindow::is_default_widget(const weld::Widget *) const()
6202 #endif
6203 }
6204
6205 virtual bool is_default_widget(const weld::Widget* pCandidate) const override
6206 {
6207 const GtkInstanceWidget* pGtkCandidate = dynamic_cast<const GtkInstanceWidget*>(pCandidate);
>>> CID 1497856: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pGtkCandidate" to "getWidget", which dereferences it.
6208 GtkWidget* pWidget = pGtkCandidate->getWidget();
6209 #if GTK_CHECK_VERSION(4, 0, 0)
6210 return gtk_window_get_default_widget(m_pWindow) == pWidget;
6211 #else
6212 gboolean has_default(false);
6213 g_object_get(G_OBJECT(pWidget), "has-default", &has_default, nullptr);
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DMmak_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJinyuKboJ-2FsEuORy-2FFDF4uBe-2B8qujnjk8h4Nu7QsdEZQoRlyOKqrEDpEqAWv96do5YZzROm96OKz6MFbnI3TyeZKanMJwW1MkKsptud3mB0vY25lt6aKA4ziZxyRlkWyOExUshPsyp5HNxhfMyeAvC7ZAEYha6wDkcDrwm131MCmE-3D
More information about the LibreOffice
mailing list