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

bugzilla-daemon at jacorb.org bugzilla-daemon at jacorb.org
Thu Nov 6 18:09:15 CET 2014


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: jacorb-bugs at lists.spline.inf.fu-berlin.de
          Reporter: juergen at jwi.de

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spline.inf.fu-berlin.de/pipermail/jacorb-bugs/attachments/20141106/4bf24fae/attachment.html>


More information about the jacorb-bugs mailing list