[jcifs] StringIndexOutOfBoundsException

Alexey Zabrodin zabrodin at gorod.ru
Sat Jul 19 01:21:05 EST 2003

With jcifs-0.7.11 it works fine. But when we used jcifs-0.6.5 it also
worked! So, maybe you should pay attention again to version 0.7.8, because
this can be a version-unstable problem... It is more likely if nobody have
been worked on this particular issue since 0.7.8.
As Mike asked me for, I send him the listing of a malicious directory (this
is my Windows directory). For the reasons of
place saving, I send it to his mailbox mba2000 at ioplex.com

And this is the exact exception trace caused by this directory, regardless
of whether it is a share or a directory within a share.
During the experiment I have set both listSize and listCount properties 10
times greater than default.

java.lang.StringIndexOutOfBoundsException: String index out of range: 4480
        at java.lang.String.<init>(String.java:432)
        at java.lang.String.<init>(String.java:477)
        at jcifs.smb.SmbTransport.run(SmbTransport.java:363)
        at java.lang.Thread.run(Thread.java:479)

-----Original Message-----
From: Michael B Allen [mailto:mba2000 at ioplex.com]
Sent: Friday, July 18, 2003 7:33 AM
To: Øâåö Àíäðåé
Cc: jcifs at lists.samba.org
Subject: Re: [jcifs] StringIndexOutOfBoundsException

> Hi,
> When I explore with jcifs 0.7.8 any shares with some 200 or more files
> them, I get the following exception in SmbTransport,

Can you generate a list of the files in that directory somehow? It must
have something to do with the filenames or something because I've never
seen jCIFS have a problem listing big directories (e.g. 15,000 files).

Just as an experiment can you try the latest jcifs-0.7.11. Also two
properties that effect this operation are jcifs.smb.client.listSize
(default 1200) and jcifs.smb.client.listCount (default 15). If the
exception is at buffer index 4980 that suggests something is becoming
unhinged. It would be interesting to see what buffer size was negotiated.
If you took a packet capture I could see that.

Also, what server are you testing this against?


More information about the jcifs mailing list