Bug 5017 - JCIFS fails to parse Trans2 response (FIND_FIRST2) if FIND_FIRST2 Data is not terminated with null (4 bytes)
JCIFS fails to parse Trans2 response (FIND_FIRST2) if FIND_FIRST2 Data is not...
Status: NEW
Product: jCIFS
Classification: Unclassified
Component: core
1.2
x86 Linux
: P3 normal
: ---
Assigned To: Samba Bugzilla Account
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-11 02:43 UTC by Krishna
Modified: 2009-04-13 08:15 UTC (History)
0 users

See Also:


Attachments
screen shot of FIND_FIRST2 response with null termination (68.55 KB, image/x-png)
2007-10-11 02:45 UTC, Krishna
no flags Details
screen shot of FIND_FIRST2 response without null termination (66.52 KB, image/x-png)
2007-10-11 02:45 UTC, Krishna
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krishna 2007-10-11 02:43:43 UTC
If the 3rd party file (or cache) server sends FIND_FIRST2 response without null termination, JCIFS fails to parse the response resulting in FIND_NEXT2 request not being sent. But Windows File server client parses this response fine.

After looking into the "Trans2FindFirst2Response.java", the condition where "lastName" value is initialized fails and "lastName" was set to null value. When JCIFS tries to send FIND_NEXT2 request with this "lastName" (which contains null value), it aborts with Exception.

Patch for fixing the issue:

#diff Trans2FindFirst2Response.java.orig Trans2FindFirst2Response.java.patch

166c166,167
<         SmbFindFileBothDirectoryInfo e;
---
>         SmbFindFileBothDirectoryInfo e = null;
>         lastName = null;

208a210,214
>
>         if (lastName == null) {
>             lastName = e.filename;
>             resumeKey = e.fileIndex;
>         }
Comment 1 Krishna 2007-10-11 02:45:09 UTC
Created attachment 2940 [details]
screen shot of FIND_FIRST2 response with null termination
Comment 2 Krishna 2007-10-11 02:45:35 UTC
Created attachment 2941 [details]
screen shot of FIND_FIRST2 response without null termination
Comment 3 Michael B. Allen 2007-10-11 15:57:11 UTC
Will apply. Not sure when I'll get around to it but I've added it to The List.
Comment 4 Gerald (Jerry) Carter 2009-04-13 08:15:08 UTC
Reassigning since current assignee mail addr is bouncing