[Xfce4-commits] [xfce/xfce4-settings] 01/01: Fix CID 337242: Null pointer dereferences (REVERSE_INULL)

noreply at xfce.org noreply at xfce.org
Sat Mar 23 16:22:42 CET 2019


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-settings.

commit 7e66c847c870a45ccaf4a527ec5f8a8aa7b01429
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Mar 23 11:22:35 2019 -0400

    Fix CID 337242: Null pointer dereferences (REVERSE_INULL)
---
 xfsettingsd/displays.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c
index 32b5002..8c9823b 100644
--- a/xfsettingsd/displays.c
+++ b/xfsettingsd/displays.c
@@ -455,11 +455,17 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent,
         {
             display = gdk_display_get_default ();
             xfce_randr = xfce_randr_new (display, &error);
-            profiles = display_settings_get_profiles (xfce_randr, helper->channel);
             if (xfce_randr)
+            {
+                profiles = display_settings_get_profiles (xfce_randr, helper->channel);
                 xfce_randr_free (xfce_randr);
+            }
 
-            if (g_list_length (profiles) == 1)
+            if (profiles == NULL)
+            {
+                xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "No matching display profiles found.");
+            }
+            else if (g_list_length (profiles) == 1)
             {
                 profile = g_list_nth_data (profiles, 0);
                 xfce_randr_apply (xfce_randr, (gchar *)profile, helper->channel);
@@ -470,10 +476,6 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent,
                 g_free (property);
                 return GDK_FILTER_CONTINUE;
             }
-            else if (profiles == NULL)
-            {
-                xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "No matching display profiles found.");
-            }
             else
             {
                 xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "Found %d matching display profiles.", g_list_length (profiles));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list