[sctp-dev] Request for review: 6916890
Alan Bateman
Alan.Bateman at Sun.COM
Mon Jan 18 03:14:20 PST 2010
Christopher Hegarty -Sun Microsystems Ireland wrote:
>
> In the case where a heap buffer is supplied the implementation copies
> the data into a temporary native buffer before going native. The
> position and remaining data is incorrectly determined for this
> temporary buffer when the position of the original buffer is not 0.
>
> Also, remove incorrect assertion from implementation.
>
> CR 6916890: SctpChannel.send may cause IAE if given a heap buffer with
> an offset
>
> Webrev:
> http://cr.openjdk.java.net/~chegar/6916890/webrev.0/webrev/
>
> Thanks,
> -Chris.
In SctpChannelImpl it looks like you can move lines 985-988 to after
you've checked if the user's buffer is direct or not - that would avoid
fetching the position and limit twice for the direct buffer case. Same
comment for SctpMultiChannelImpl. Otherwise the implementation change
looks right to me. For the tests, one suggestion is to go a step further
and verify the received message. Without that it only checks the return
value and that the buffer position has been updated.
-Alan.
More information about the sctp-dev
mailing list