[jcifs] StringIndexOutOfBoundsException

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Mon Jul 21 11:52:18 EST 2003

> -----Original Message-----
> From:	Alexey Zabrodin [SMTP:zabrodin at gorod.ru]
> Sent:	Friday, July 18, 2003 11:21 AM
> To:	jcifs at lists.samba.org
> Subject:	Re: [jcifs] StringIndexOutOfBoundsException
> 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 
> 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.
	That's going to be a problem pre-0.7.10. If you look at the CHANGES.txt file
	I fixed a bug that caused this kind of problem with certain combinations of
	listSize and listCount. I didn't mention this before because with the default
	values this should not happen. Did you change the listSize/listCount
	parameters before too? From looking at your file listing there is nothing
	unusal about your directory listing.

> 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.Trans2FindFirst2Response.readString(Trans2FindFirst2Respons
> e.java:91)
>         at
> jcifs.smb.Trans2FindFirst2Response.readDataWireFormat(Trans2FindFirst
> 2Response.java:174)
>         at
> jcifs.smb.SmbComTransactionResponse.readBytesWireFormat(SmbComTransac
> tionResponse.java:136)
>         at
> jcifs.smb.ServerMessageBlock.readWireFormat(ServerMessageBlock.java:4
> 29)
>         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
> in
> > 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?
> Thanks,
> Mike

More information about the jcifs mailing list