cifs: Rename cifs_strncpy_to_host and fix buffer size
authorSuresh Jayaraman <sjayaraman@suse.de>
Mon, 20 Apr 2009 13:24:21 +0000 (18:54 +0530)
committerSteve French <sfrench@us.ibm.com>
Mon, 20 Apr 2009 19:58:06 +0000 (19:58 +0000)
commit968460ebd8006d55661dec0fb86712b40d71c413
treedf76b9f2928e4c347a79a9837815d4a5a6e8c7cf
parentff6945279d45edd8f6b0a5ddb1ef16cecce3ea9c
cifs: Rename cifs_strncpy_to_host and fix buffer size

There is a possibility for the path_name and node_name buffers to
overflow if they contain charcters that are >2 bytes in the local
charset. Resize the buffer allocation so to avoid this possibility.

Also, as pointed out by Jeff Layton, it would be appropriate to
rename the function to cifs_strlcpy_to_host to reflect the fact
that the copied string is always NULL terminated.

Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifssmb.c