a small patch



There is a missing update of the current pointer.

Index: corba-object.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/orb/orb-core/corba-object.c,v
retrieving revision 1.15
diff -u -r1.15 corba-object.c
--- corba-object.c	2000/11/17 01:15:45	1.15
+++ corba-object.c	2000/12/29 12:13:03
@@ -818,6 +826,7 @@
   retval->object_key_vec.iov_base = &retval->object_key_data;
   retval->object_key_vec.iov_len = 4 + rlen;
 
+  buf->cur += len;
   return retval;
 
  errout:




I guess there are some more bugs in the marshaling code.  E.g. nil object
references should be marshaled without segfaults.  Something like this could
help:


Index: corba-object.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/orb/orb-core/corba-object.c,v
retrieving revision 1.15
diff -u -r1.15 corba-object.c
--- corba-object.c	2000/11/17 01:15:45	1.15
+++ corba-object.c	2000/12/29 12:13:03
@@ -766,20 +766,28 @@
 void
 ORBit_marshal_object(GIOPSendBuffer *buf, CORBA_Object obj)
 {
-  CORBA_unsigned_long type_len, num_profiles;
-  GSList *cur;
-
-  giop_send_buffer_align(buf, 4);
-  type_len = strlen(obj->type_id) + 1;
-  giop_send_buffer_append_indirect(buf, &type_len, 4);
-  giop_send_buffer_append(buf, obj->type_id, type_len);
-  num_profiles = g_slist_length(obj->profile_list);
   giop_send_buffer_align(buf, 4);
-  giop_send_buffer_append_indirect(buf, &num_profiles, 4);
-  
-  for(cur = obj->profile_list; cur; cur = cur->next)
+  if (!obj)
     {
-      ORBit_marshal_profile(buf, cur->data);
+      CORBA_unsigned_long n = 0;
+      giop_send_buffer_append(buf, "\0\0\0\3nil\0\0\0\0\0", 12);
+    }
+  else
+    {
+      CORBA_unsigned_long type_len, num_profiles;
+      GSList *cur;
+
+      type_len = strlen(obj->type_id) + 1;
+      giop_send_buffer_append_indirect(buf, &type_len, 4);
+      giop_send_buffer_append(buf, obj->type_id, type_len);
+      num_profiles = g_slist_length(obj->profile_list);
+      giop_send_buffer_align(buf, 4);
+      giop_send_buffer_append_indirect(buf, &num_profiles, 4);
+      
+      for(cur = obj->profile_list; cur; cur = cur->next)
+	{
+	  ORBit_marshal_profile(buf, cur->data);
+	}
     }
 }
 


Anybody got the orbit-name-server and name-client (current repo versions)
working again?

There is a segfault whenever the principal_vec in giop-send-buffer is NULL.
I don't know if this is the right thing but at least it stops segfaulting:

Index: giop-send-buffer.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/orb/GIOP/giop-send-buffer.c,v
retrieving revision 1.9
diff -u -r1.9 giop-send-buffer.c
--- giop-send-buffer.c	2000/10/26 23:55:16	1.9
+++ giop-send-buffer.c	2000/12/29 12:23:40
@@ -128,7 +128,10 @@
 			     const struct iovec *operation_vec,
 			     const struct iovec *principal_vec)
 {
+  struct iovec nullvec = { NULL, 0 };
   GIOPSendBuffer *buf = giop_send_buffer_use(giop_version);
+
+  if (!principal_vec) principal_vec = &nullvec;
 
   buf->msg.header.message_type = GIOP_REQUEST;
   giop_send_buffer_align(buf, sizeof(CORBA_unsigned_long));



-- 
Francisco Moya Fernandez          Arquitectura y Tecnologia de Computadores
Prof. Ayudante de Facultad               Departamento de Informatica
fmoya inf-cr uclm es                 Escuela Superior de Informatica (CR)
Fax:(+34 926) 29 53 91                Universidad de Castilla La Mancha
Tel:(+34 926) 29 53 00 ext 3729          http://www.inf-cr.uclm.es/




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