[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 22 13:43:46 UTC 2021


 vcl/unx/gtk3/gtk3gtkinst.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 3c4089e80504dfc1a1bb53b478394df2f788cc85
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Mar 22 10:26:04 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Mar 22 14:42:58 2021 +0100

    cid#1474236 silence bogus Use after free
    
    Change-Id: Ia46fb86c64d66b8489f45e369a901c5b9abf03ba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112875
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index ec8d970caad3..2b9463544c5d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1871,6 +1871,7 @@ namespace
         gtk_widget_set_halign(pReplacement, gtk_widget_get_halign(pWidget));
         gtk_widget_set_valign(pReplacement, gtk_widget_get_valign(pWidget));
 
+        // coverity[freed_arg : FALSE] - this does not free pWidget, it is reffed by pReplacement
         g_object_unref(pWidget);
     }
 
@@ -1880,6 +1881,7 @@ namespace
 
         replaceWidget(pWidget, pReplacement);
 
+        // coverity[pass_freed_arg : FALSE] - pWidget is not freed here due to initial g_object_ref
         gtk_container_add(GTK_CONTAINER(pReplacement), pWidget);
 
         // coverity[freed_arg : FALSE] - this does not free pWidget, it is reffed by pReplacement
@@ -6262,6 +6264,7 @@ private:
         std::swap(m_nStartTabCount, m_nEndTabCount);
         split_notebooks();
 
+        // coverity[pass_freed_arg : FALSE] - m_pNotebook is not freed here
         gtk_notebook_set_current_page(m_pNotebook, nNewPage);
 
         enable_notify_events();
@@ -6389,6 +6392,7 @@ private:
              make_overflow_boxes();
 
         // don't scroll the tabs anymore
+        // coverity[pass_freed_arg : FALSE] - m_pNotebook is not freed here
         gtk_notebook_set_scrollable(m_pNotebook, false);
 
         gtk_widget_freeze_child_notify(GTK_WIDGET(m_pNotebook));


More information about the Libreoffice-commits mailing list