[omniORB] 4.0.X and 4.1.X Alignment bug when parsing GIOP 1.2 Reply when using service contexts

Jonathan Biggar jon at levanta.com
Mon Dec 10 17:49:26 GMT 2007


GIOP 1.2 requires the REPLY body to be aligned on an 8 byte boundary. 
omniORB has the code to do this alignment for normal replies and system 
exceptions, but is missing the alignment call for user exceptions and 
location forward replies.

This bug only manifests itself if service contexts are used to transmit 
additional data from the CORBA server back to the client, and then only 
if the service context length doesn't leave the alignment on an 8 byte 
boundary already.

This bug appears in omniORB 4.0.X and 4.1.[01].

Here is a patch relative to omniORB 4.0.5 for the functions 
giopImpl12::sendUserException and giopImpl12::sendLocationForwardReply:

+++ giopImpl12.cc       2007-12-10 16:36:37.000000000 -0800
@@ -1704,6 +1704,8 @@
   // Service context
   giop_s.service_contexts() >>= s;

+  s.alignOutput(omni::ALIGN_8);
+
   // RepoId
   CORBA::ULong(repoid_size) >>= s;
   s.put_octet_array((const CORBA::Octet*) repoid, repoid_size);
@@ -1751,6 +1753,7 @@
   // Service context
   operator>>= ((CORBA::ULong)0,s);

+  s.alignOutput(omni::ALIGN_8);

   // object reference
   CORBA::Object::_marshalObjRef(obj,s);

-- 
Jon Biggar
Levanta Inc
jon at levanta.com




More information about the omniORB-list mailing list