diff options
author | Zhao Hongjiang <zhaohongjiang@huawei.com> | 2013-06-24 01:57:47 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-06-26 17:25:20 -0500 |
commit | 46b51d0835ef1e75dd48fe10c90f9c775301d9ee (patch) | |
tree | 4980c0ef982dbfb3737496967c1155643f39b2d5 /fs/cifs/connect.c | |
parent | be7457d388d25e5d2ebba4c7f216b47b5e3d1eef (diff) | |
download | linux-46b51d0835ef1e75dd48fe10c90f9c775301d9ee.tar.bz2 |
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/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 2 |
1 files changed, 1 insertions, 1 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, } bcc_ptr += length + 1; bytes_left -= (length + 1); - strncpy(tcon->treeName, tree, MAX_TREE_SIZE); + strlcpy(tcon->treeName, tree, sizeof(tcon->treeName)); /* mostly informational -- no need to fail on error here */ kfree(tcon->nativeFileSystem); |