NULL-terminate all strings coming in over the wire protocol. Should help

2007-12-11  Sven Neumann  <sven@gimp.org>

	* libgimpbase/gimpwire.c (_gimp_read_read_string): 
NULL-terminate
	all strings coming in over the wire protocol. Should help with 
bug
	#498207.


svn path=/trunk/; revision=24312
This commit is contained in:
Sven Neumann 2007-12-11 07:16:04 +00:00 committed by Sven Neumann
parent 40f237269c
commit 09cca4bf9a
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2007-12-11 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpwire.c (_gimp_read_read_string): NULL-terminate
all strings coming in over the wire protocol. Should help with bug
#498207.
2007-12-10 Sven Neumann <sven@gimp.org>
* plug-ins/pygimp/gimpmodule.c (pygimp_set_background)

View File

@ -433,12 +433,16 @@ _gimp_wire_read_string (GIOChannel *channel,
if (tmp > 0)
{
data[i] = g_new (gchar, tmp);
if (! _gimp_wire_read_int8 (channel,
(guint8 *) data[i], tmp, user_data))
{
g_free (data[i]);
return FALSE;
}
/* make sure that the string is NULL-terminated */
data[i][tmp - 1] = '\0';
}
else
{