Author: zoltan
Date: 2005-03-04 11:12:10 -0500 (Fri, 04 Mar 2005)
New Revision: 41447

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/object.c
Log:
2005-03-04  Zoltan Varga  <[EMAIL PROTECTED]>

        * object.c (mono_load_remote_field_new): Fix returning uninitialized
        memory when the remoting callback does not sets the out arguments.
        Fixes #73007.


Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2005-03-04 16:02:44 UTC (rev 41446)
+++ trunk/mono/mono/metadata/ChangeLog  2005-03-04 16:12:10 UTC (rev 41447)
@@ -1,5 +1,9 @@
 2005-03-04  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * object.c (mono_load_remote_field_new): Fix returning uninitialized
+       memory when the remoting callback does not sets the out arguments.
+       Fixes #73007.
+
        * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
        by mistake.
 

Modified: trunk/mono/mono/metadata/object.c
===================================================================
--- trunk/mono/mono/metadata/object.c   2005-03-04 16:02:44 UTC (rev 41446)
+++ trunk/mono/mono/metadata/object.c   2005-03-04 16:12:10 UTC (rev 41447)
@@ -3536,6 +3536,9 @@
 
        if (exc) mono_raise_exception ((MonoException *)exc);
 
+       if (mono_array_length (out_args) == 0)
+               return NULL;
+
        *res = mono_array_get (out_args, MonoObject *, 0);
 
        if (field_class->valuetype) {
@@ -3586,6 +3589,7 @@
        
        msg = (MonoMethodMessage *)mono_object_new (domain, 
mono_defaults.mono_method_message_class);
        out_args = mono_array_new (domain, mono_defaults.object_class, 1);
+
        mono_message_init (domain, msg, mono_method_get_object (domain, getter, 
NULL), out_args);
 
        mono_array_set (msg->args, gpointer, 0, mono_string_new (domain, 
klass->name));
@@ -3595,7 +3599,10 @@
 
        if (exc) mono_raise_exception ((MonoException *)exc);
 
-       res = mono_array_get (out_args, MonoObject *, 0);
+       if (mono_array_length (out_args) == 0)
+               res = NULL;
+       else
+               res = mono_array_get (out_args, MonoObject *, 0);
 
        return res;
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to