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

David Wuertele dave-gnus at bfnet.com
Tue Sep 28 19:34:10 GMT 2004


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



More information about the linux-cifs-client mailing list