mirror of https://github.com/GNOME/gimp.git
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:
parent
4e9fcfa632
commit
083c7c9116
14
ChangeLog
14
ChangeLog
|
@ -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>
|
2001-08-31 Thomas Canty <tommydal@optushome.com.au>
|
||||||
|
|
||||||
* app/colormaps.c
|
* app/colormaps.c
|
||||||
* app/gdisplay.c
|
* app/gdisplay.c
|
||||||
* app/nav_window.c
|
* app/nav_window.c
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -429,7 +429,7 @@ gimp_brush_load_brush (gint fd,
|
||||||
GimpBrush *brush;
|
GimpBrush *brush;
|
||||||
gint bn_size;
|
gint bn_size;
|
||||||
BrushHeader header;
|
BrushHeader header;
|
||||||
gchar *name;
|
gchar *name = NULL;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_return_val_if_fail (filename != NULL, NULL);
|
g_return_val_if_fail (filename != NULL, NULL);
|
||||||
|
@ -477,11 +477,18 @@ gimp_brush_load_brush (gint fd,
|
||||||
g_free (name);
|
g_free (name);
|
||||||
return NULL;
|
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
|
|
||||||
{
|
if (!name)
|
||||||
name = g_strdup (_("Unnamed"));
|
name = g_strdup (_("Unnamed"));
|
||||||
}
|
|
||||||
|
|
||||||
switch (header.bytes)
|
switch (header.bytes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -429,7 +429,7 @@ gimp_brush_load_brush (gint fd,
|
||||||
GimpBrush *brush;
|
GimpBrush *brush;
|
||||||
gint bn_size;
|
gint bn_size;
|
||||||
BrushHeader header;
|
BrushHeader header;
|
||||||
gchar *name;
|
gchar *name = NULL;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_return_val_if_fail (filename != NULL, NULL);
|
g_return_val_if_fail (filename != NULL, NULL);
|
||||||
|
@ -477,11 +477,18 @@ gimp_brush_load_brush (gint fd,
|
||||||
g_free (name);
|
g_free (name);
|
||||||
return NULL;
|
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
|
|
||||||
{
|
if (!name)
|
||||||
name = g_strdup (_("Unnamed"));
|
name = g_strdup (_("Unnamed"));
|
||||||
}
|
|
||||||
|
|
||||||
switch (header.bytes)
|
switch (header.bytes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -300,13 +300,23 @@ gimp_brush_pipe_load (const gchar *filename)
|
||||||
if (buffer->len > 0 && buffer->len < 1024)
|
if (buffer->len > 0 && buffer->len < 1024)
|
||||||
{
|
{
|
||||||
pipe = GIMP_BRUSH_PIPE (g_object_new (GIMP_TYPE_BRUSH_PIPE, NULL));
|
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);
|
g_string_free (buffer, TRUE);
|
||||||
|
|
||||||
if (!pipe)
|
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);
|
filename);
|
||||||
close (fd);
|
close (fd);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -300,13 +300,23 @@ gimp_brush_pipe_load (const gchar *filename)
|
||||||
if (buffer->len > 0 && buffer->len < 1024)
|
if (buffer->len > 0 && buffer->len < 1024)
|
||||||
{
|
{
|
||||||
pipe = GIMP_BRUSH_PIPE (g_object_new (GIMP_TYPE_BRUSH_PIPE, NULL));
|
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);
|
g_string_free (buffer, TRUE);
|
||||||
|
|
||||||
if (!pipe)
|
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);
|
filename);
|
||||||
close (fd);
|
close (fd);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -320,8 +320,17 @@ gimp_gradient_load (const gchar *filename)
|
||||||
fgets (line, 1024, file);
|
fgets (line, 1024, file);
|
||||||
if (! strncmp (line, "Name: ", strlen ("Name: ")))
|
if (! strncmp (line, "Name: ", strlen ("Name: ")))
|
||||||
{
|
{
|
||||||
gimp_object_set_name (GIMP_OBJECT (gradient),
|
if (g_utf8_validate (line, -1, NULL))
|
||||||
g_strstrip (&line[strlen ("Name: ")]));
|
{
|
||||||
|
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);
|
fgets (line, 1024, file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,8 +301,16 @@ gimp_palette_load (const gchar *filename)
|
||||||
|
|
||||||
if (! strncmp (str, "Name: ", strlen ("Name: ")))
|
if (! strncmp (str, "Name: ", strlen ("Name: ")))
|
||||||
{
|
{
|
||||||
gimp_object_set_name (GIMP_OBJECT (palette),
|
if (g_utf8_validate (str, -1, NULL))
|
||||||
g_strstrip (&str[strlen ("Name: ")]));
|
{
|
||||||
|
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))
|
if (! fgets (str, 1024, fp))
|
||||||
{
|
{
|
||||||
|
@ -487,7 +495,6 @@ gimp_palette_add_entry (GimpPalette *palette,
|
||||||
{
|
{
|
||||||
GimpPaletteEntry *entry;
|
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 (GIMP_IS_PALETTE (palette), NULL);
|
||||||
|
|
||||||
g_return_val_if_fail (color != NULL, NULL);
|
g_return_val_if_fail (color != NULL, NULL);
|
||||||
|
@ -514,7 +521,6 @@ gimp_palette_delete_entry (GimpPalette *palette,
|
||||||
GList *list;
|
GList *list;
|
||||||
gint pos = 0;
|
gint pos = 0;
|
||||||
|
|
||||||
g_return_if_fail (palette != NULL);
|
|
||||||
g_return_if_fail (GIMP_IS_PALETTE (palette));
|
g_return_if_fail (GIMP_IS_PALETTE (palette));
|
||||||
|
|
||||||
g_return_if_fail (entry != NULL);
|
g_return_if_fail (entry != NULL);
|
||||||
|
|
|
@ -301,8 +301,16 @@ gimp_palette_load (const gchar *filename)
|
||||||
|
|
||||||
if (! strncmp (str, "Name: ", strlen ("Name: ")))
|
if (! strncmp (str, "Name: ", strlen ("Name: ")))
|
||||||
{
|
{
|
||||||
gimp_object_set_name (GIMP_OBJECT (palette),
|
if (g_utf8_validate (str, -1, NULL))
|
||||||
g_strstrip (&str[strlen ("Name: ")]));
|
{
|
||||||
|
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))
|
if (! fgets (str, 1024, fp))
|
||||||
{
|
{
|
||||||
|
@ -487,7 +495,6 @@ gimp_palette_add_entry (GimpPalette *palette,
|
||||||
{
|
{
|
||||||
GimpPaletteEntry *entry;
|
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 (GIMP_IS_PALETTE (palette), NULL);
|
||||||
|
|
||||||
g_return_val_if_fail (color != NULL, NULL);
|
g_return_val_if_fail (color != NULL, NULL);
|
||||||
|
@ -514,7 +521,6 @@ gimp_palette_delete_entry (GimpPalette *palette,
|
||||||
GList *list;
|
GList *list;
|
||||||
gint pos = 0;
|
gint pos = 0;
|
||||||
|
|
||||||
g_return_if_fail (palette != NULL);
|
|
||||||
g_return_if_fail (GIMP_IS_PALETTE (palette));
|
g_return_if_fail (GIMP_IS_PALETTE (palette));
|
||||||
|
|
||||||
g_return_if_fail (entry != NULL);
|
g_return_if_fail (entry != NULL);
|
||||||
|
|
|
@ -301,8 +301,16 @@ gimp_palette_load (const gchar *filename)
|
||||||
|
|
||||||
if (! strncmp (str, "Name: ", strlen ("Name: ")))
|
if (! strncmp (str, "Name: ", strlen ("Name: ")))
|
||||||
{
|
{
|
||||||
gimp_object_set_name (GIMP_OBJECT (palette),
|
if (g_utf8_validate (str, -1, NULL))
|
||||||
g_strstrip (&str[strlen ("Name: ")]));
|
{
|
||||||
|
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))
|
if (! fgets (str, 1024, fp))
|
||||||
{
|
{
|
||||||
|
@ -487,7 +495,6 @@ gimp_palette_add_entry (GimpPalette *palette,
|
||||||
{
|
{
|
||||||
GimpPaletteEntry *entry;
|
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 (GIMP_IS_PALETTE (palette), NULL);
|
||||||
|
|
||||||
g_return_val_if_fail (color != NULL, NULL);
|
g_return_val_if_fail (color != NULL, NULL);
|
||||||
|
@ -514,7 +521,6 @@ gimp_palette_delete_entry (GimpPalette *palette,
|
||||||
GList *list;
|
GList *list;
|
||||||
gint pos = 0;
|
gint pos = 0;
|
||||||
|
|
||||||
g_return_if_fail (palette != NULL);
|
|
||||||
g_return_if_fail (GIMP_IS_PALETTE (palette));
|
g_return_if_fail (GIMP_IS_PALETTE (palette));
|
||||||
|
|
||||||
g_return_if_fail (entry != NULL);
|
g_return_if_fail (entry != NULL);
|
||||||
|
|
|
@ -312,11 +312,18 @@ gimp_pattern_load (const gchar *filename)
|
||||||
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
|
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
|
||||||
goto error;
|
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
|
|
||||||
{
|
if (!name)
|
||||||
name = g_strdup (_("Unnamed"));
|
name = g_strdup (_("Unnamed"));
|
||||||
}
|
|
||||||
|
|
||||||
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
|
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
|
||||||
|
|
||||||
|
|
|
@ -312,11 +312,18 @@ gimp_pattern_load (const gchar *filename)
|
||||||
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
|
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
|
||||||
goto error;
|
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
|
|
||||||
{
|
if (!name)
|
||||||
name = g_strdup (_("Unnamed"));
|
name = g_strdup (_("Unnamed"));
|
||||||
}
|
|
||||||
|
|
||||||
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
|
pattern = GIMP_PATTERN (g_object_new (GIMP_TYPE_PATTERN, NULL));
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -1833,6 +1833,7 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
GSList *tmp = NULL;
|
GSList *tmp = NULL;
|
||||||
gchar *prog = NULL;
|
gchar *prog = NULL;
|
||||||
gboolean add_proc_def;
|
gboolean add_proc_def;
|
||||||
|
gboolean valid;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Argument checking
|
/* Argument checking
|
||||||
|
@ -1890,10 +1891,10 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
||||||
{
|
{
|
||||||
if ((proc_install->nparams < 5) ||
|
if ((proc_install->nparams < 5) ||
|
||||||
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
||||||
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
||||||
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
(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))
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
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++)
|
for (i = 1; i < proc_install->nparams; i++)
|
||||||
{
|
{
|
||||||
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
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_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)
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
||||||
{
|
{
|
||||||
g_message ("Plug-In \"%s\"\n(%s)\n"
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
||||||
|
@ -1940,6 +1942,49 @@ plug_in_handle_proc_install (GPProcInstall *proc_install)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 */
|
/* Initialization */
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
* Jörn Loviscach.
|
* Jörn Loviscach.
|
||||||
*
|
*
|
||||||
* It appeared in c't 10/95, page 326 and is called
|
* It appeared in c't 10/95, page 326 and is called
|
||||||
* "Ausgewürfelt - Moderne Kunst algorithmisch erzeugen".
|
* "Ausgewürfelt - Moderne Kunst algorithmisch erzeugen"
|
||||||
* (~modern art created with algorithms)
|
* (~modern art created with algorithms).
|
||||||
*
|
*
|
||||||
* It generates one main formula (the middle button) and 8 variations of it.
|
* 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
|
* 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,
|
gimp_install_procedure (PLUG_IN_NAME,
|
||||||
"Create images based on a random genetic formula",
|
"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.",
|
"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",
|
||||||
"Jörn Loviscach, Jens Ch. Restemeier",
|
"Jörn Loviscach, Jens Ch. Restemeier",
|
||||||
PLUG_IN_VERSION,
|
PLUG_IN_VERSION,
|
||||||
N_("<Image>/Filters/Render/Pattern/Qbist..."),
|
N_("<Image>/Filters/Render/Pattern/Qbist..."),
|
||||||
"RGB*",
|
"RGB*",
|
||||||
|
|
Loading…
Reference in New Issue