[jcifs] Patch: SocketOutputStream bugfix

Michael B. Allen miallen at eskimo.com
Wed Feb 5 08:01:25 EST 2003


Yikes! 0.7.2 coming up.

This is because I increased the default jcifs.smb.client.snd_buf_size
to 5000 when I released 0.7.0. Incedentally to get around this users
can simply set it back to 1300.

What is also disturbing are those Log.printlns in SocketOutputStream and
SmbOutputStream that are going to explode into StringBuffers. I think
I was making assumptions about the size of things that at this point is
no longer true. I'll have to look at this a lot closer.

Good catch,
Mike

On Tue, 4 Feb 2003 11:08:11 -0800 
Thomas Krammer <TKrammer at nxn-software.com> wrote:

> Hi,
> 
> I've found a bug in the SocketOutputStream.write() method. If len is in the
> range [1501, 1503] an ArrayIndexOutOfBoundsException is thrown. That's
> because 4 bytes in the buffer are reserved for the package header which
> isn't taken into account when the method checks if it needs to create a
> temporary buffer.
> 
> This problem occured during my tests because the last WriteAndX block of a
> transfer was exactly 1501 bytes long.
> 
> The following patch fixes the problem:

-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and, more important, to tasks that have not
yet been conceived. 


More information about the jcifs mailing list