mirror of https://github.com/GNOME/gimp.git
use g_try_new() so a plug-in can't easily crash the core by sending an
2007-12-11 Sven Neumann <sven@gimp.org> * libgimpbase/gimpwire.c (_gimp_wire_read_string): use g_try_new() so a plug-in can't easily crash the core by sending an invalid string message. svn path=/trunk/; revision=24316
This commit is contained in:
parent
18db691f0e
commit
a23029a05f
|
@ -1,3 +1,9 @@
|
|||
2007-12-11 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpbase/gimpwire.c (_gimp_wire_read_string): use g_try_new()
|
||||
so a plug-in can't easily crash the core by sending an invalid
|
||||
string message.
|
||||
|
||||
2007-12-11 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpbase/gimpwire.c (gimp_wire_register): allocate
|
||||
|
|
|
@ -432,7 +432,13 @@ _gimp_wire_read_string (GIOChannel *channel,
|
|||
|
||||
if (tmp > 0)
|
||||
{
|
||||
data[i] = g_new (gchar, tmp);
|
||||
data[i] = g_try_new (gchar, tmp);
|
||||
|
||||
if (! data[i])
|
||||
{
|
||||
g_printerr ("%s: failed to allocate %u bytes\n", G_STRFUNC, tmp);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (! _gimp_wire_read_int8 (channel,
|
||||
(guint8 *) data[i], tmp, user_data))
|
||||
|
|
Loading…
Reference in New Issue