Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues

Bug 941

Summary: Enable to rewrite on a RequestOutputStream with big size
Product: JacORB Reporter: Corsaire <ze_corsaire>
Component: ORBAssignee: Mailinglist to track bugs <jacorb-bugs>
Status: RESOLVED FIXED    
Severity: major CC: jacorb, ze_corsaire
Priority: P2    
Version: 3.2   
Hardware: PC   
OS: All   
Attachments: test case
proposal correction

Description Corsaire 2013-02-01 16:36:36 UTC
When we try to rewrite a big array octet on a RequestOutputStream using write_octet_array method we have an exception later on writing this RequestOutputStream on a connection.

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
 at java.lang.System.arraycopy(Native Method)
 at java.io.BufferedOutputStream.write(Unknown Source)
 at org.jacorb.orb.etf.StreamConnectionBase.write StreamConnectionBase.java:190)
at org.jacorb.orb.giop.GIOPConnection.write(GIOPConnection.java:949)
at org.jacorb.orb.CDROutputStream.write(CDROutputStream.java:450)
at org.jacorb.orb.giop.ServiceContextTransportingOutputStream.write_to(ServiceContextTransportingOutputStream.java:143)
at org.jacorb.orb.giop.RequestOutputStream.write_to(RequestOutputStream.java:309)
at org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:1060)

Problem is that, on method write_octet_array Jacorb always adds a new DefferedWriteFrame whithout looking for writing current index.
Comment 1 Corsaire 2013-02-01 16:37:49 UTC
Created attachment 403 [details]
test case
Comment 2 Corsaire 2013-02-01 16:40:55 UTC
Created attachment 404 [details]
proposal correction
Comment 3 Nick Cross 2013-06-21 10:46:52 UTC
Fix and adapted manual test into automated regression test.

https://github.com/JacORB/JacORB/pull/59