make sure the name list array is NULL terminated. Fixes #356435.

2006-12-10  Luca Cavalli  <lcavalli@cvs.gnome.org>

	* font-method.c: (ensure_font_list): make sure the name list array
	is NULL terminated. Fixes #356435.

svn path=/trunk/; revision=7051
This commit is contained in:
Luca Cavalli 2007-01-06 18:04:20 +00:00 committed by Rodrigo Moya
parent e2dbb55aab
commit 198a954b80
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2006-12-10 Luca Cavalli <lcavalli@cvs.gnome.org>
* font-method.c: (ensure_font_list): make sure the name list array
is NULL terminated. Fixes #356435.
2006-07-23 Sebastien Bacher <seb128@debian.org>
* font-method.directory.in: add encoding key,

View file

@ -171,8 +171,8 @@ ensure_font_list(void)
goto end;
}
/* set up name list and hash */
font_names = g_new(gchar *, font_list->nfont);
/* set up name list and hash (name list array must be NULL terminated) */
font_names = g_new0(gchar *, font_list->nfont + 1);
font_hash = g_hash_table_new(g_str_hash, g_str_equal);
for (i = 0; i < font_list->nfont; i++) {
font_names[i] = get_pango_name(font_list->fonts[i]);