Commit 9c16c2fc authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

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.
parent 92f5d97b
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.
......
......@@ -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.
*/
......
......@@ -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.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment