fix SEGV by not using uninitialized memory as array index.
authorMichael Natterer <mitch@imendio.com>
Tue, 10 Jun 2008 10:51:29 +0000 (10:51 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Tue, 10 Jun 2008 10:51:29 +0000 (10:51 +0000)
2008-06-10  Michael Natterer  <mitch@imendio.com>

* gcontenttype.c (g_content_type_get_icon): fix SEGV by not using
uninitialized memory as array index.

svn path=/trunk/; revision=6981

gio/ChangeLog
gio/gcontenttype.c

index 576533a..a5e3f66 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-10  Michael Natterer  <mitch@imendio.com>
+
+       * gcontenttype.c (g_content_type_get_icon): fix SEGV by not using
+       uninitialized memory as array index.
+
 2008-06-10  Tor Lillqvist  <tml@novell.com>
 
        * gcontenttype.c (g_content_type_can_be_executable)
index 1ac22cb..617c523 100644 (file)
@@ -676,7 +676,7 @@ g_content_type_get_icon (const char *type)
   char *mimetype_icon, *generic_mimetype_icon, *q;
   char *xdg_mimetype_icon, *legacy_mimetype_icon;
   char *icon_names[4];
-  int n;
+  int n = 0;
   const char *p;
   GIcon *themed_icon;