[glib] gdesktopappinfo: fix a crasher



commit afaee8dc6ad72281dd1a51ebae58aaabf0efdb05
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Apr 15 14:10:39 2014 -0400

    gdesktopappinfo: fix a crasher
    
    During the time that we are expanding the strv, it is not
    null-terminated.  Use the strv_len variable instead to bound the search
    for duplicates.

 gio/gdesktopappinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 8d1bc69..0b72803 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -663,7 +663,7 @@ expand_strv (gchar         ***strv_ptr,
             goto no_add;
 
       /* Don't add duplicates already in the list */
-      for (j = 0; strv[j]; j++)
+      for (j = 0; j < strv_len; j++)
         if (g_str_equal (to_add[i], strv[j]))
           goto no_add;
 


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