Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4332373

CDRInputStream.read_Object makes bad assumption about IOR

XMLWordPrintable

    • beta
    • x86
    • windows_nt
    • Not verified



      Name: tb29552 Date: 04/21/2000


      java version "1.3.0rc2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc2-Y)
      Java HotSpot(TM) Client VM (build 1.3.0rc2-Y, mixed mode)

      I believe the class com.sun.corba.se.internal.iiop.CDRInputStream.java class
      has a bug in the read_Object(Class) method. It appears that this method
      assumes that if the host component of the IOR is the current host, then the IOR
      must contain a SUN ORB ServerId. The fragement of code that suggests this is
         if(s.equals(orb.getORBServerHost()))
         {
            int i = Utility.bytesToInt(abyte0, 8); // ArrayIndexOutOfBoundsException

      The bytesToInt method will fail if the object key is less than 8 + 4 bytes. I
      am running another ORB on the same host which generates small object keys.
      When an IOR from this ORB came through JDK1.3 CDRInputStream.read_Object
      (Class), I got the folloing exception:

       ERROR: java.lang.ArrayIndexOutOfBoundsException
       java.lang.ArrayIndexOutOfBoundsException at
       com.sun.corba.se.internal.util.Utility.bytesToInt(Utility.java:1041) at
       com.sun.corba.se.internal.iiop.CDRInputStream.read_Object
      (CDRInputStream.java:605) at
       com.sun.corba.se.internal.iiop.CDRInputStream.read_Object
      (CDRInputStream.java:577)

      It is not safe to assume the size of the IOR's Object key

      I potential solution would be to check both host and port before performing the
      bytesToInt method
         if(s.equals(orb.getORBServerHost()) && port == orb.getORBServerPort())
      (Review ID: 103888)
      ======================================================================

      **********************************************************************

      ###@###.### 2001-09-28

      fix verified ok

      with build
      j2sdk-1_4_0-beta3-bin-b81-solsparc-27_sep_2001

      by code inspection

      com/sun/corba/se/internal/iiop/CDRInputStream.java
      com/sun/corba/se/internal/ior/ObjectKeyFactory.java

      ***********************************************************************

            eandersosunw Everett Anderson (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: