diff --git a/fs/hmdfs/inode_root.c b/fs/hmdfs/inode_root.c index 30d0ca6a2264020fd54c9e856a2dc5497214a787..b3b2b5c2b2fc2c0b3a0a8d60cf010f27632b33c9 100644 --- a/fs/hmdfs/inode_root.c +++ b/fs/hmdfs/inode_root.c @@ -153,7 +153,7 @@ struct dentry *hmdfs_device_lookup(struct inode *parent_inode, ret_dentry = ERR_PTR(err); goto out; } - memcpy(cid, d_name, HMDFS_CID_SIZE); + strncpy(cid, d_name, HMDFS_CID_SIZE); cid[HMDFS_CID_SIZE] = '\0'; con = hmdfs_lookup_from_cid(sbi, cid); if (!con) {