--- thunar-vfs-os-bsd.c.orig Thu Sep 7 20:35:54 2006 +++ thunar-vfs-os-bsd.c Fri Sep 8 00:42:57 2006 @@ -41,6 +41,8 @@ #ifdef HAVE_UNISTD_H #include #endif +#include +#include #include #include @@ -184,7 +186,7 @@ #endif GList *path_list = NULL; gchar *filename; - gchar *dbuf; + gchar *dbuf = NULL; guint dlen; gint size; gint loc; @@ -240,7 +242,8 @@ /* allocate the directory buffer, which is * also used to store the statfs(2) results. */ - dbuf = alloca (dlen); + if ((dbuf = calloc(1, dlen)) == NULL) + err(1, "calloc"); /* read the directory content */ for (loc = size = 0;;) @@ -311,6 +314,7 @@ } done: + free(dbuf); close (fd); return path_list; }