Re: [gnome-db] Patch for bug in gda_value_copy



El mar, 11-11-2003 a las 19:58, David Marín Carreño escribió:
> Hi all.
> 
> We have found a little nasty bug :-) in gda_value_copy that made
> segfaults when gda_value_free'ing the generated copy.
> 
> So in libgda/gda-value.c, in line 966 it was:
> 
> 	case GDA_VALUE_TYPE_NUMERIC :
> 		memcpy (&copy->value.v_numeric, &value->value.v_numeric, sizeof (GdaNumeric));
> 		break;
> 
> But it must be:
> 
> 	case GDA_VALUE_TYPE_NUMERIC :
> 		memcpy (&copy->value.v_numeric, &value->value.v_numeric, sizeof (GdaNumeric));
> 		copy->value.v_numeric.number = g_strdup (value->value.v_numeric.number);
> 		break;
> 
> The string that contains the number must also be copied :-). If it's not
> copied, when we free it, we have a problem (haha).
> 
> Please, fix it in CVS.

Done for HEAD and release-1-0-branch.
Thanks!

-Gonzalo

-- 
Gonzalo Paniagua Javier <gonzalo gnome-db org>
http://www.gnome-db.org/~gonzalo/







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]