diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/connect.c | 2 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d5f866afe560..53a1780cd073 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -3732,7 +3732,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses, | |||
3732 | } | 3732 | } |
3733 | bcc_ptr += length + 1; | 3733 | bcc_ptr += length + 1; |
3734 | bytes_left -= (length + 1); | 3734 | bytes_left -= (length + 1); |
3735 | strncpy(tcon->treeName, tree, MAX_TREE_SIZE); | 3735 | strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); |
3736 | 3736 | ||
3737 | /* mostly informational -- no need to fail on error here */ | 3737 | /* mostly informational -- no need to fail on error here */ |
3738 | kfree(tcon->nativeFileSystem); | 3738 | kfree(tcon->nativeFileSystem); |
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)) |