]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix length handling in cifs_get_name_from_search_buf
authorJeff Layton <jlayton@redhat.com>
Fri, 1 May 2009 00:45:45 +0000 (20:45 -0400)
committerSteve French <sfrench@us.ibm.com>
Fri, 1 May 2009 00:49:23 +0000 (00:49 +0000)
commite45b581b746cedf0e9e192a05afc643d79fa753a
tree33bb2720165640fefc2987878a507d6797994891
parent5cafcbc3d0380c807cb34ccce4f7c033384926ab
cifs: fix length handling in cifs_get_name_from_search_buf

The earlier patch to move this code to use the new unicode helpers
assumed that the filename strings would be null terminated. That's not
always the case.

Instead of passing "max_len" to the string converter, pass "min(len,
max_len)", which makes it do the right thing while still keeping the
parser confined to the response. Also fix up the prototypes of this
function and the callers so that max_len is unsigned (like len is).

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/readdir.c