[PATCH] eCryptfs: Fix pointer deref

Michael Halcrow
2006-10-31T19:23:10Z

On Mon, Oct 30, 2006 at 05:36:37PM -0600, Michael Halcrow wrote:
> + algified_name_len = (chaining_modifier_len + cipher_name_len + 3);
> + (*algified_name) = kmalloc(algified_name_len, GFP_KERNEL);
> + if (!(algified_name)) {
> + rc = -ENOMEM;
> + goto out;
> + }

I missed a pointer dereference in this kmalloc result check.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>

---

fs/ecryptfs/crypto.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

b30f5b01ff79d9250dbd9e39db1c1aae7719c815
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 3f83613..9333fa3 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -134,7 +134,7 @@ int ecryptfs_crypto_api_algify_cipher_na

algified_name_len = (chaining_modifier_len + cipher_name_len + 3);
(*algified_name) = kmalloc(algified_name_len, GFP_KERNEL);
- if (!(algified_name)) {
+ if (!(*algified_name)) {
rc = -ENOMEM;
goto out;
}
--
1.3.3