]> Dogcows Code - chaz/openbox/blobdiff - obt/paths.c
found memory corruption in the obt xqueue and paths
[chaz/openbox] / obt / paths.c
index e2e4859b8d94385053c1f50bcf46a172bdc71b5e..b20eb48d1139459cbaf2e99e9bb0b497528494e2 100644 (file)
@@ -126,7 +126,7 @@ static void find_uid_gid(uid_t *u, gid_t **g, guint *n)
     }
     endgrent();
 
-    qsort(*g, sizeof(gid_t), *n, gid_cmp);
+    qsort(*g, *n, sizeof(gid_t), gid_cmp);
 }
 
 ObtPaths* obt_paths_new(void)
@@ -331,7 +331,8 @@ static inline gboolean try_exec(const ObtPaths *const p,
     struct stat st;
     BSEARCH_SETUP(guint);
 
-    stat(path, &st);
+    if (stat(path, &st) != 0)
+        return FALSE;
 
     if (!S_ISREG(st.st_mode))
         return FALSE;
This page took 0.026062 seconds and 4 git commands to generate.