don't crash on invalid regular expressions.

2005-05-13  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-ins-query.c (plug_ins_query): don't crash on
	invalid regular expressions.
This commit is contained in:
Michael Natterer 2005-05-13 08:40:10 +00:00 committed by Michael Natterer
parent 92f5d97b9e
commit 9c16c2fc40
3 changed files with 27 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2005-05-13 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-ins-query.c (plug_ins_query): don't crash on
invalid regular expressions.
2005-05-13 Sven Neumann <sven@gimp.org>
* plug-ins/bmp/bmpwrite.c (WriteBMP): added missing brackets.

View file

@ -72,11 +72,19 @@ plug_ins_query (Gimp *gimp,
g_return_val_if_fail (realname_strs != NULL, 0);
g_return_val_if_fail (time_ints != NULL, 0);
if (search_str && strlen (search_str))
regcomp (&sregex, search_str, REG_ICASE);
else
*menu_strs = NULL;
*accel_strs = NULL;
*prog_strs = NULL;
*types_strs = NULL;
*realname_strs = NULL;
*time_ints = NULL;
if (search_str && ! strlen (search_str))
search_str = NULL;
if (search_str && regcomp (&sregex, search_str, REG_ICASE))
return 0;
/* count number of plugin entries, then allocate arrays of correct size
* where we can store the strings.
*/

View file

@ -72,11 +72,19 @@ plug_ins_query (Gimp *gimp,
g_return_val_if_fail (realname_strs != NULL, 0);
g_return_val_if_fail (time_ints != NULL, 0);
if (search_str && strlen (search_str))
regcomp (&sregex, search_str, REG_ICASE);
else
*menu_strs = NULL;
*accel_strs = NULL;
*prog_strs = NULL;
*types_strs = NULL;
*realname_strs = NULL;
*time_ints = NULL;
if (search_str && ! strlen (search_str))
search_str = NULL;
if (search_str && regcomp (&sregex, search_str, REG_ICASE))
return 0;
/* count number of plugin entries, then allocate arrays of correct size
* where we can store the strings.
*/