diff options
author | Jeff Layton <jlayton@redhat.com> | 2008-09-24 11:32:59 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-09-24 19:07:36 +0000 |
commit | 391e575556109744ae0aa198c1e245588a3ea76a (patch) | |
tree | 90980d20d071415ba7f601acd3139ae7121123bf /fs/cifs | |
parent | 7ce86d5a93ffe2542e6558a97ab055377df8cde3 (diff) | |
download | op-kernel-dev-391e575556109744ae0aa198c1e245588a3ea76a.zip op-kernel-dev-391e575556109744ae0aa198c1e245588a3ea76a.tar.gz |
cifs: remove NULL termination from rename target in CIFSSMBRenameOpenFIle
cifs: remove NULL termination from rename target in CIFSSMBRenameOpenFIle
The rename destination isn't supposed to be null terminated. Also,
change the name string arg to be const.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsproto.h | 2 | ||||
-rw-r--r-- | fs/cifs/cifssmb.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 014f26c..0cff7fe 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h @@ -231,7 +231,7 @@ extern int CIFSSMBRename(const int xid, struct cifsTconInfo *tcon, const struct nls_table *nls_codepage, int remap_special_chars); extern int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon, - int netfid, char *target_name, + int netfid, const char *target_name, const struct nls_table *nls_codepage, int remap_special_chars); extern int CIFSCreateHardLink(const int xid, diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 7b36584..7504d15 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -2017,7 +2017,7 @@ renameRetry: } int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon, - int netfid, char *target_name, + int netfid, const char *target_name, const struct nls_table *nls_codepage, int remap) { struct smb_com_transaction2_sfi_req *pSMB = NULL; @@ -2071,7 +2071,7 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon, remap); } rename_info->target_name_len = cpu_to_le32(2 * len_of_str); - count = 12 /* sizeof(struct set_file_rename) */ + (2 * len_of_str) + 2; + count = 12 /* sizeof(struct set_file_rename) */ + (2 * len_of_str); byte_count += count; pSMB->DataCount = cpu_to_le16(count); pSMB->TotalDataCount = pSMB->DataCount; |