diff options
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r-- | fs/ecryptfs/crypto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index c01e043670e2..f6caeb1d1106 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -1716,7 +1716,7 @@ static int ecryptfs_copy_filename(char **copied_name, size_t *copied_name_size, | |||
1716 | { | 1716 | { |
1717 | int rc = 0; | 1717 | int rc = 0; |
1718 | 1718 | ||
1719 | (*copied_name) = kmalloc((name_size + 2), GFP_KERNEL); | 1719 | (*copied_name) = kmalloc((name_size + 1), GFP_KERNEL); |
1720 | if (!(*copied_name)) { | 1720 | if (!(*copied_name)) { |
1721 | rc = -ENOMEM; | 1721 | rc = -ENOMEM; |
1722 | goto out; | 1722 | goto out; |
@@ -1726,7 +1726,7 @@ static int ecryptfs_copy_filename(char **copied_name, size_t *copied_name_size, | |||
1726 | * in printing out the | 1726 | * in printing out the |
1727 | * string in debug | 1727 | * string in debug |
1728 | * messages */ | 1728 | * messages */ |
1729 | (*copied_name_size) = (name_size + 1); | 1729 | (*copied_name_size) = name_size; |
1730 | out: | 1730 | out: |
1731 | return rc; | 1731 | return rc; |
1732 | } | 1732 | } |