[linux-cifs-client] Unicode/UTF8 in 1.22

Steven French sfrench at us.ibm.com
Tue Sep 28 19:57:38 GMT 2004


No - it really is wrong.  Part of the code being fixed.


Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com



David Wuertele <dave-gnus at bfnet.com> 
Sent by: linux-cifs-client-bounces+sfrench=us.ibm.com at lists.samba.org
09/28/2004 02:34 PM

To
linux-cifs-client at lists.samba.org
cc

Subject
[linux-cifs-client] Unicode/UTF8 in 1.22






OK, I just browsed through the diffs between cifs v1.22 and v1.20.  I
thought that someone here mentioned there were fixes for the Unicode
string length bugs in 1.22, but it appears to me that the string
lengths are being calculated exactly the same way.  For example, in
cifs/file.c, the diff from 1.20 to 1.22 has a chunk that contains the
following (I've compressed the lines so they don't wrap in email):

                 if (Unicode == TRUE)
-                                pfindData->FileNameLength =
+                                len =
                                     cifs_strfromUCS_le
                                     (pfindData->FileName,
                                      (wchar_t *)
                                      pfindData->FileName,
-                                     (pfindData->
-                                      FileNameLength) / 2,
+                                     len / 2,
                                      cifs_sb->local_nls);

Looks to me like the file name buffer length is still being assumed to
be the number of unicode characters devided by two.  This will choke
on some UTF-8 strings which commonly contain three-byte characters.

Am I reading this wrong?

Thanks,
Dave

_______________________________________________
linux-cifs-client mailing list
linux-cifs-client at lists.samba.org
http://lists.samba.org/mailman/listinfo/linux-cifs-client

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the linux-cifs-client mailing list