Skip to contentSkip to conversation

fs: ecryptfs: initialize payload_len in keystore.c

PATCH In review Simon Que 2 participants 2 messages Jan 17, 2013 Ecrypt file system

lore
Share & tools
lore

Simon Que

author
#0 lore raw

PATCH v2 1/1 fs: ecryptfs: initialize payload_len in keystore.c

This is meant to remove a compiler warning. It should not make any functional change.

payload_len should be initialized when it is passed to write_tag_64_packet() as a pointer. If that call fails, this function should return early, and payload_len won't be used.

---
 fs/ecryptfs/keystore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ecryptfs/keystore.c +1 -1
index 2333203..6154cde 100644
@@ -1150,7 +1150,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
 	struct ecryptfs_message *msg = NULL;
 	char *auth_tok_sig;
 	char *payload;
-	size_t payload_len;
+	size_t payload_len = 0;
 	int rc;
 
 	rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok);
Signature · 1 line
1.7.8.6
#1 lore raw
Quoted 8 lines · Simon Que

This is meant to remove a compiler warning. It should not make any functional change.

payload_len should be initialized when it is passed to write_tag_64_packet() as a pointer. If that call fails, this function should return early, and payload_len won't be used.

Thanks for resubmitting. I've pushed it to the next branch at:

http://git.kernel.org/?p=linux/kernel/git/tyhicks/ecryptfs.git;a=summary

Tyler

Quoted 24 lines
---
 fs/ecryptfs/keystore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ecryptfs/keystore.c +1 -1
index 2333203..6154cde 100644
@@ -1150,7 +1150,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
 	struct ecryptfs_message *msg = NULL;
 	char *auth_tok_sig;
 	char *payload;
-	size_t payload_len;
+	size_t payload_len = 0;
 	int rc;
 
 	rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok);
Signature · 6 lines
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe ecryptfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html