Re: a small patch



On Fri, 29 Dec 2000, Paco Moya wrote:

> 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;

Added.

> 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)
>  {

I made a slightly different change that should achieve the same goal.
> 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));

This is not quite the correct solution - one needs to at least encode the
fact that the principal has zero length. I've put a patch that should fix
this.

Thank you very much for taking a look at ORBit2 - I think you are the
first to send in patches. :)
-- Elliot
Who me? I just wander from room to room.





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