# HG changeset patch # User Sadrul Habib Chowdhury # Date 1184996704 0 # Node ID dcb1d1af30a1603add41910246a6f0443f712bbd # Parent 2a431f30af2a33ce969f8bdfbfb7e51b9e0168c0 This could have resulted in buffer overflow if the user had 10 or more workspaces. diff -r 2a431f30af2a -r dcb1d1af30a1 finch/libgnt/gntstyle.c --- a/finch/libgnt/gntstyle.c Fri Jul 20 21:49:53 2007 +0000 +++ b/finch/libgnt/gntstyle.c Sat Jul 21 05:45:04 2007 +0000 @@ -145,8 +145,8 @@ int j; GntWS *ws; gchar **titles; - char *group = calloc(12, 1); - g_sprintf(group, "Workspace-%d", i); + char group[32]; + g_snprintf(group, sizeof(group), "Workspace-%d", i); name = g_key_file_get_value(gkfile, group, "name", NULL); if (!name) return; @@ -168,7 +168,6 @@ g_hash_table_replace(wm->title_places, g_strdup(titles[j]), ws); g_strfreev(titles); } - g_free(group); } #endif }