[Bug 996] New: read_fixed() fails with 0

[email protected] Thu, 06 Nov 2014 17:09:15 +0000
Newsgroups gmane.comp.corba.jacorb.bugs
Message-ID <[email protected]/bugzilla/>
http://www.jacorb.org/bugzilla/show_bug.cgi?id=996

            Bug ID: 996
           Summary: read_fixed() fails with 0
           Product: JacORB
           Version: 3.5
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5
         Component: ORB
          Assignee: [email protected]
          Reporter: [email protected]

If you send BigDecimal(new BigInteger("0")) over the wire, the receiving JacORB
fails with Zero length BigInteger.

Problem is at CDRInputStream.java:897 read_fixed_internal()

For 0 the CDR representation is 0C

so (outBuffer.length() > 0 || c != 0) is false || false and the 0 gets ignored.


47 49 4F 50  01 02 00 01  00 00 00 0D  00 00 00 04  GIOP .... .... .... 
00 00 00 00  00 00 00 00  0C                        .... .... .
FINE read GIOP message of size 25 from ClientGIOPConnection to
172.20.6.163:61759 (1010058)
java.lang.NumberFormatException: Zero length BigInteger
    at java.math.BigInteger.<init>(BigInteger.java:276)
    at java.math.BigInteger.<init>(BigInteger.java:451)
    at org.jacorb.orb.CDRInputStream.read_fixed(CDRInputStream.java:838)
    at demo.hello.FixedStructHelper.read(FixedStructHelper.java:41)
    at demo.hello._GoodDayStub.testFixed(_GoodDayStub.java:102)
    at demo.hello.Client.main(Client.java:65)

To reproduce:

struct FixedStruct
    {
        fixed<1,0> fnull; 
    };     

        interface GoodDay {
...            
            FixedStruct testFixed(in FixedStruct fs);         
        };

return with new BigDecimal(new BigInteger("0"))

-- 
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
jacorb-bugs mailing list
[email protected]
https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-bugs