harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Blewitt" <alex.blew...@gmail.com>
Subject Re: Re: Exceptions found while running servlet...
Date Thu, 10 Aug 2006 08:40:12 GMT
On 10/08/06, Jimmy, Jing Lv <firepure@gmail.com> wrote:
>
> I've looked into this, I feel puzzled, the stack trace shows that:
> org.apache.harmony.luni.net.SocketOutputStream.write(SocketOutputStream.java:89)
>
> but there are checks for overflow:
> if (0 <= offset && offset <= buffer.length && 0 <= count
>                         && count <= buffer.length - offset){
> ...
> }

What would happen if you were writing out "" and the buffer was
zero-sized? Should it be offset < buffer.length instead of offset <=
buffer.length?

Not knowing where the code is, this is just a guess, but if
buffer.length is the size, then the range would be [0,buffer.length-1]
which suggests a less-than would fix that type of issue ...

(Of course, I could be completely wrong :-)

Alex.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message