diff --git a/NEWS b/NEWS index b548d886f0812295f439db0bc1164cf4dd6e2d34..843990143fd81b930946212dfe6758b6f4fcfbcd 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ - Don't interpret file display names as format strings (bug #7128). - Ship stock_folder-copy.png and stock_folder-move.png icons with Thunar itself (bug #6851). +- Fix segfault when calling strcasecmp with NULL parameters (bug #7206). 1.2.0 ===== diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c index dacb4ad3906247af398a2a10dcfeb7ad2c7e1ee7..f5e42b313a900539944aca4fc085446e360219ba 100644 --- a/thunar/thunar-list-model.c +++ b/thunar/thunar-list-model.c @@ -1,7 +1,7 @@ /* $Id$ */ /*- * Copyright (c) 2004-2007 Benedikt Meurer <benny@xfce.org> - * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org> + * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -1643,6 +1643,15 @@ sort_by_type (const ThunarFile *a, description_b = g_content_type_get_description (content_type_b); } + /* avoid calling strcasecmp with NULL parameters */ + if (description_a == NULL || description_b == NULL) + { + g_free (description_a); + g_free (description_b); + + return 0; + } + if (!case_sensitive) result = strcasecmp (description_a, description_b); else