[network-manager-applet] mobile-helpers: don't try to add access tech icon if unknown



commit cd60dfe6455269d1703024a30bfea169f968299f
Author: Aleksander Morgado <aleksander aleksander es>
Date:   Fri Feb 13 19:03:04 2015 +0100

    mobile-helpers: don't try to add access tech icon if unknown
    
    If we cannot get an icon name to use based on the access tech, don't segfault.
    Instead, just ignore the access tech icon.
    
        Program received signal SIGSEGV, Segmentation fault.
        0xb6ffb07a in g_str_hash () from /usr/lib/libglib-2.0.so.0
        (gdb) bt full
        #0 0xb6ffb07a in g_str_hash () from /usr/lib/libglib-2.0.so.0
        No symbol table info available.
        #1 0xb6ffa4a8 in g_hash_table_lookup () from /usr/lib/libglib-2.0.so.0
        No symbol table info available.
        #2 0x0805dfef in nma_icon_check_and_load ()
        No symbol table info available.
        #3 0x0806e778 in mobile_helper_get_status_pixbuf ()
        No symbol table info available.
        #4 0x0806f042 in mobile_helper_get_icon ()
        No symbol table info available.
        #5 0x080724d2 in ?? ()
        No symbol table info available.
        #6 0x0805e80a in ?? ()
        No symbol table info available.
        #7 0xb7008130 in ?? () from /usr/lib/libglib-2.0.so.0
        No symbol table info available.
        #8 0xb700b8d3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
        No symbol table info available.
        #9 0xb700bce9 in ?? () from /usr/lib/libglib-2.0.so.0
        No symbol table info available.
        #10 0xb700c099 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
        No symbol table info available.
        #11 0x08056654 in main ()
    
    https://bugs.archlinux.org/task/43576
    https://bugzilla.gnome.org/show_bug.cgi?id=744421

 src/mobile-helpers.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/mobile-helpers.c b/src/mobile-helpers.c
index 9cfb5fe..4da1d97 100644
--- a/src/mobile-helpers.c
+++ b/src/mobile-helpers.c
@@ -78,13 +78,20 @@ mobile_helper_get_status_pixbuf (guint32 quality,
                                                          0, 0, 1.0, 1.0,
                                                          GDK_INTERP_BILINEAR, 255);
        } else {
-               tmp = nma_icon_check_and_load (mobile_helper_get_tech_icon_name (access_tech), applet);
-               if (tmp) {
-                       gdk_pixbuf_composite (tmp, pixbuf, 0, 0,
-                                                 gdk_pixbuf_get_width (tmp),
-                                                                 gdk_pixbuf_get_height (tmp),
-                                                                 0, 0, 1.0, 1.0,
-                                                                 GDK_INTERP_BILINEAR, 255);
+               const gchar *tech_icon_name;
+
+               /* Only try to add the access tech info icon if we get a valid
+                * access tech reported. */
+               tech_icon_name = mobile_helper_get_tech_icon_name (access_tech);
+               if (tech_icon_name) {
+                       tmp = nma_icon_check_and_load (tech_icon_name, applet);
+                       if (tmp) {
+                               gdk_pixbuf_composite (tmp, pixbuf, 0, 0,
+                                                     gdk_pixbuf_get_width (tmp),
+                                                     gdk_pixbuf_get_height (tmp),
+                                                     0, 0, 1.0, 1.0,
+                                                     GDK_INTERP_BILINEAR, 255);
+                       }
                }
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]