diff options
author | Zhao Hongjiang <zhaohongjiang@huawei.com> | 2013-06-24 02:57:47 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-06-26 18:25:20 -0400 |
commit | 46b51d0835ef1e75dd48fe10c90f9c775301d9ee (patch) | |
tree | 4980c0ef982dbfb3737496967c1155643f39b2d5 /fs/cifs/smb2pdu.c | |
parent | be7457d388d25e5d2ebba4c7f216b47b5e3d1eef (diff) |
cifs: using strlcpy instead of strncpy
for NUL terminated string, need alway set '\0' in the end.
Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r-- | fs/cifs/smb2pdu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index f7422a68b163..92fd6c59c125 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
@@ -746,7 +746,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, | |||
746 | tcon->tidStatus = CifsGood; | 746 | tcon->tidStatus = CifsGood; |
747 | tcon->need_reconnect = false; | 747 | tcon->need_reconnect = false; |
748 | tcon->tid = rsp->hdr.TreeId; | 748 | tcon->tid = rsp->hdr.TreeId; |
749 | strncpy(tcon->treeName, tree, MAX_TREE_SIZE); | 749 | strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); |
750 | 750 | ||
751 | if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && | 751 | if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) && |
752 | ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) | 752 | ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0)) |