diff --git a/app/plug-in/plug-in-rc.c b/app/plug-in/plug-in-rc.c index 411d997191..1cd95a4719 100644 --- a/app/plug-in/plug-in-rc.c +++ b/app/plug-in/plug-in-rc.c @@ -273,6 +273,12 @@ plug_in_def_deserialize (Gimp *gimp, if (! gimp_scanner_parse_string (scanner, &path)) return G_TOKEN_STRING; + if (! (path && *path)) + { + g_scanner_error (scanner, "plug-in filename is empty"); + return G_TOKEN_ERROR; + } + file = gimp_file_new_for_config_path (path, &error); g_free (path); @@ -383,12 +389,27 @@ plug_in_procedure_deserialize (GScanner *scanner, if (! gimp_scanner_parse_string (scanner, &str)) return G_TOKEN_STRING; + if (! (str && *str)) + { + g_scanner_error (scanner, "procedure name is empty"); + return G_TOKEN_ERROR; + } + if (! gimp_scanner_parse_int (scanner, &proc_type)) { g_free (str); return G_TOKEN_INT; } + if (proc_type != GIMP_PLUGIN && + proc_type != GIMP_EXTENSION) + { + g_free (str); + g_scanner_error (scanner, "procedure type %d is out of range", + proc_type); + return G_TOKEN_ERROR; + } + procedure = gimp_plug_in_procedure_new (proc_type, file); *proc = GIMP_PLUG_IN_PROCEDURE (procedure);