app/plug_in.c app/core/gimpbrush.c app/core/gimpbrushpipe.c

2001-09-03  Sven Neumann  <sven@gimp.org>

	* app/plug_in.c
	* app/core/gimpbrush.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpgradient.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c: check strings from data files and plug-in
	registration for UTF-8 validity. There are probably a lot more places
	that need these checks.

	* plug-ins/common/gqbist.c: converted PDB texts to UTF-8.
This commit is contained in:
Sven Neumann 2001-09-03 00:26:06 +00:00 committed by Sven Neumann
parent 4e9fcfa632
commit 083c7c9116
32 changed files with 1130 additions and 141 deletions

View File

@ -1,4 +1,18 @@
2001-09-03 Sven Neumann <sven@gimp.org>
* app/plug_in.c
* app/core/gimpbrush.c
* app/core/gimpbrushpipe.c
* app/core/gimpgradient.c
* app/core/gimppalette.c
* app/core/gimppattern.c: check strings from data files and plug-in
registration for UTF-8 validity. There are probably a lot more places
that need these checks.
* plug-ins/common/gqbist.c: converted PDB texts to UTF-8.
2001-08-31 Thomas Canty <tommydal@optushome.com.au>
* app/colormaps.c
* app/gdisplay.c
* app/nav_window.c

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -429,7 +429,7 @@ gimp_brush_load_brush (gint fd,
GimpBrush *brush;
gint bn_size;
BrushHeader header;
gchar *name;
gchar *name = NULL;
gint i;
g_return_val_if_fail (filename != NULL, NULL);
@ -477,11 +477,18 @@ gimp_brush_load_brush (gint fd,
g_free (name);
return NULL;
}
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in GIMP brush file \"%s\"."),
filename);
g_free (name);
name = NULL;
}
}
else
{
name = g_strdup (_("Unnamed"));
}
if (!name)
name = g_strdup (_("Unnamed"));
switch (header.bytes)
{

View File

@ -429,7 +429,7 @@ gimp_brush_load_brush (gint fd,
GimpBrush *brush;
gint bn_size;
BrushHeader header;
gchar *name;
gchar *name = NULL;
gint i;
g_return_val_if_fail (filename != NULL, NULL);
@ -477,11 +477,18 @@ gimp_brush_load_brush (gint fd,
g_free (name);
return NULL;
}
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in GIMP brush file \"%s\"."),
filename);
g_free (name);
name = NULL;
}
}
else
{
name = g_strdup (_("Unnamed"));
}
if (!name)
name = g_strdup (_("Unnamed"));
switch (header.bytes)
{

View File

@ -300,13 +300,23 @@ gimp_brush_pipe_load (const gchar *filename)
if (buffer->len > 0 && buffer->len < 1024)
{
pipe = GIMP_BRUSH_PIPE (g_object_new (GIMP_TYPE_BRUSH_PIPE, NULL));
gimp_object_set_name (GIMP_OBJECT (pipe), buffer->str);
if (g_utf8_validate (buffer->str, buffer->len, NULL))
{
gimp_object_set_name (GIMP_OBJECT (pipe), buffer->str);
}
else
{
g_message (_("Invalid UTF-8 string in GIMP brush file \"%s\"."),
filename);
gimp_object_set_name (GIMP_OBJECT (pipe), _("Unnamed"));
}
}
g_string_free (buffer, TRUE);
if (!pipe)
{
g_message ("Couldn't read name for brush pipe from file '%s'\n",
g_message ("Couldn't read name for brush pipe from file \"%s\".\n",
filename);
close (fd);
return NULL;

View File

@ -300,13 +300,23 @@ gimp_brush_pipe_load (const gchar *filename)
if (buffer->len > 0 && buffer->len < 1024)
{
pipe = GIMP_BRUSH_PIPE (g_object_new (GIMP_TYPE_BRUSH_PIPE, NULL));
gimp_object_set_name (GIMP_OBJECT (pipe), buffer->str);
if (g_utf8_validate (buffer->str, buffer->len, NULL))
{
gimp_object_set_name (GIMP_OBJECT (pipe), buffer->str);
}
else
{
g_message (_("Invalid UTF-8 string in GIMP brush file \"%s\"."),
filename);
gimp_object_set_name (GIMP_OBJECT (pipe), _("Unnamed"));
}
}
g_string_free (buffer, TRUE);
if (!pipe)
{
g_message ("Couldn't read name for brush pipe from file '%s'\n",
g_message ("Couldn't read name for brush pipe from file \"%s\".\n",
filename);
close (fd);
return NULL;

View File

@ -320,8 +320,17 @@ gimp_gradient_load (const gchar *filename)
fgets (line, 1024, file);
if (! strncmp (line, "Name: ", strlen ("Name: ")))
{
gimp_object_set_name (GIMP_OBJECT (gradient),
g_strstrip (&line[strlen ("Name: ")]));
if (g_utf8_validate (line, -1, NULL))
{
gimp_object_set_name (GIMP_OBJECT (gradient),
g_strstrip (&line[strlen ("Name: ")]));
}
else
{
g_message (_("Invalid UTF-8 string in GIMP gradient file \"%s\"."),
filename);
gimp_object_set_name (GIMP_OBJECT (gradient), _("Unnamed"));
}
fgets (line, 1024, file);
}

View File

@ -301,8 +301,16 @@ gimp_palette_load (const gchar *filename)
if (! strncmp (str, "Name: ", strlen ("Name: ")))
{
gimp_object_set_name (GIMP_OBJECT (palette),
g_strstrip (&str[strlen ("Name: ")]));
if (g_utf8_validate (str, -1, NULL))
{
gimp_object_set_name (GIMP_OBJECT (palette),
g_strstrip (&str[strlen ("Name: ")]));
}
else
{
g_message (_("Invalid UTF-8 string in palette file '%s'"), filename);
gimp_object_set_name (GIMP_OBJECT (palette), _("Unnamed"));
}
if (! fgets (str, 1024, fp))
{
@ -487,7 +495,6 @@ gimp_palette_add_entry (GimpPalette *palette,
{
GimpPaletteEntry *entry;
g_return_val_if_fail (palette != NULL, NULL);
g_return_val_if_fail (GIMP_IS_PALETTE (palette), NULL);
g_return_val_if_fail (color != NULL, NULL);
@ -514,7 +521,6 @@ gimp_palette_delete_entry (GimpPalette *palette,
GList *list;
gint pos = 0;
g_return_if_fail (palette != NULL);
g_return_if_fail (GIMP_IS_PALETTE (palette));
g_return_if_fail (entry != NULL);

View File

@ -301,8 +301,16 @@ gimp_palette_load (const gchar *filename)
if (! strncmp (str, "Name: ", strlen ("Name: ")))
{
gimp_object_set_name (GIMP_OBJECT (palette),
g_strstrip (&str[strlen ("Name: ")]));
if (g_utf8_validate (str, -1, NULL))
{
gimp_object_set_name (GIMP_OBJECT (palette),
g_strstrip (&str[strlen ("Name: ")]));
}
else
{
g_message (_("Invalid UTF-8 string in palette file '%s'"), filename);
gimp_object_set_name (GIMP_OBJECT (palette), _("Unnamed"));
}
if (! fgets (str, 1024, fp))
{
@ -487,7 +495,6 @@ gimp_palette_add_entry (GimpPalette *palette,
{
GimpPaletteEntry *entry;
g_return_val_if_fail (palette != NULL, NULL);
g_return_val_if_fail (GIMP_IS_PALETTE (palette), NULL);
g_return_val_if_fail (color != NULL, NULL);
@ -514,7 +521,6 @@ gimp_palette_delete_entry (GimpPalette *palette,
GList *list;
gint pos = 0;
g_return_if_fail (palette != NULL);
g_return_if_fail (GIMP_IS_PALETTE (palette));
g_return_if_fail (entry != NULL);

View File

@ -301,8 +301,16 @@ gimp_palette_load (const gchar *filename)
if (! strncmp (str, "Name: ", strlen ("Name: ")))
{
gimp_object_set_name (GIMP_OBJECT (palette),
g_strstrip (&str[strlen ("Name: ")]));
if (g_utf8_validate (str, -1, NULL))
{
gimp_object_set_name (GIMP_OBJECT (palette),
g_strstrip (&str[strlen ("Name: ")]));
}
else
{
g_message (_("Invalid UTF-8 string in palette file '%s'"), filename);
gimp_object_set_name (GIMP_OBJECT (palette), _("Unnamed"));
}
if (! fgets (str, 1024, fp))
{
@ -487,7 +495,6 @@ gimp_palette_add_entry (GimpPalette *palette,
{
GimpPaletteEntry *entry;
g_return_val_if_fail (palette != NULL, NULL);
g_return_val_if_fail (GIMP_IS_PALETTE (palette), NULL);
g_return_val_if_fail (color != NULL, NULL);
@ -514,7 +521,6 @@ gimp_palette_delete_entry (GimpPalette *palette,
GList *list;
gint pos = 0;
g_return_if_fail (palette != NULL);
g_return_if_fail (GIMP_IS_PALETTE (palette));
g_return_if_fail (entry != NULL);

View File

@ -312,11 +312,18 @@ gimp_pattern_load (const gchar *filename)
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
goto error;
}
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in GIMP pattern file \"%s\"."),
filename);
g_free (name);
name = NULL;
}
}
else
{
name = g_strdup (_("Unnamed"));
}
if (!name)
name = g_strdup (_("Unnamed"));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));

View File

@ -312,11 +312,18 @@ gimp_pattern_load (const gchar *filename)
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
goto error;
}
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in GIMP pattern file \"%s\"."),
filename);
g_free (name);
name = NULL;
}
}
else
{
name = g_strdup (_("Unnamed"));
}
if (!name)
name = g_strdup (_("Unnamed"));
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
GSList *tmp = NULL;
gchar *prog = NULL;
gboolean add_proc_def;
gboolean valid;
gint i;
/* Argument checking
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
{
if ((proc_install->nparams < 5) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[3].type != GIMP_PDB_STRING) ||
(proc_install->params[4].type != GIMP_PDB_STRING))
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1924,9 +1925,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
for (i = 1; i < proc_install->nparams; i++)
{
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
proc_install->params[i].type == GIMP_PDB_STRINGARRAY) &&
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
&&
proc_install->params[i-1].type != GIMP_PDB_INT32)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
@ -1939,7 +1941,50 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
return;
}
}
/* Sanity check strings for UTF-8 validity */
valid = FALSE;
if ((proc_install->menu_path == NULL ||
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
(g_utf8_validate (proc_install->name, -1, NULL)) &&
(proc_install->blurb == NULL ||
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
(proc_install->help == NULL ||
g_utf8_validate (proc_install->help, -1, NULL)) &&
(proc_install->author == NULL ||
g_utf8_validate (proc_install->author, -1, NULL)) &&
(proc_install->copyright == NULL ||
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
(proc_install->date == NULL ||
g_utf8_validate (proc_install->date, -1, NULL)))
{
valid = TRUE;
for (i = 0; i < proc_install->nparams && valid; i++)
{
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
(proc_install->params[i].description == NULL ||
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
valid = FALSE;
}
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
{
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
(proc_install->return_vals[i].description == NULL ||
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
valid = FALSE;
}
}
if (!valid)
{
g_message ("Plug-In \"%s\"\n(%s)\n"
"attempted to install a procedure with invalid UTF-8 strings.\n",
g_path_get_basename (current_plug_in->args[0]),
current_plug_in->args[0]);
return;
}
/* Initialization */

View File

@ -4,8 +4,8 @@
* Jörn Loviscach.
*
* It appeared in c't 10/95, page 326 and is called
* "Ausgewürfelt - Moderne Kunst algorithmisch erzeugen".
* (~modern art created with algorithms)
* "Ausgewürfelt - Moderne Kunst algorithmisch erzeugen"
* (~modern art created with algorithms).
*
* It generates one main formula (the middle button) and 8 variations of it.
* If you select a variation it becomes the new main formula. If you
@ -416,9 +416,9 @@ query (void)
gimp_install_procedure (PLUG_IN_NAME,
"Create images based on a random genetic formula",
"This Plug-in is based on an article by Jörn Loviscach (appeared in c't 10/95, page 326). It generates modern art pictures from a random genetic formula.",
"Jörn Loviscach, Jens Ch. Restemeier",
"Jörn Loviscach, Jens Ch. Restemeier",
"This Plug-in is based on an article by Jörn Loviscach (appeared in c't 10/95, page 326). It generates modern art pictures from a random genetic formula.",
"Jörn Loviscach, Jens Ch. Restemeier",
"Jörn Loviscach, Jens Ch. Restemeier",
PLUG_IN_VERSION,
N_("<Image>/Filters/Render/Pattern/Qbist..."),
"RGB*",