* [PATCH] fs: ecryptfs: initialize payload_len in keystore.c
@ 2013-01-17 2:08 Simon Que
2013-01-17 19:08 ` Tyler Hicks
0 siblings, 1 reply; 3+ messages in thread
From: Simon Que @ 2013-01-17 2:08 UTC (permalink / raw)
To: ecryptfs, tyhicks, dustin.kirkland; +Cc: msb, Simon Que
Signed-off-by: Simon Que <sque@chromium.org>
---
fs/ecryptfs/keystore.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index 2333203..6154cde 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -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);
--
1.7.8.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fs: ecryptfs: initialize payload_len in keystore.c
2013-01-17 2:08 [PATCH] fs: ecryptfs: initialize payload_len in keystore.c Simon Que
@ 2013-01-17 19:08 ` Tyler Hicks
2013-01-17 19:15 ` Simon Que
0 siblings, 1 reply; 3+ messages in thread
From: Tyler Hicks @ 2013-01-17 19:08 UTC (permalink / raw)
To: Simon Que; +Cc: ecryptfs, dustin.kirkland, msb
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
On 2013-01-16 18:08:14, Simon Que wrote:
> Signed-off-by: Simon Que <sque@chromium.org>
Hi Simon - Thanks for the patch but please resubmit it with a
description. Even with a one-liner as simple as this, there needs to be
some background information conveyed with the change.
Is this to just quiet a useless compiler warning or is there a place
were we actually use payload_len without initializing it? If we use it
uninitialized, does it cause a crash or do we "handle" it in error
paths? These details are factored in to determine if I need to send this
to the stable team and if distros need to backport it. It also keeps me
from scratching my head a year down the road when someone asks me about
the patch with no commit message. :)
FWIW, I took a quick look and don't see how it can be used uninitialized
but maybe I'm missing something. I also don't get a compiler warning
about it when building with `make W=12 M=fs/ecryptfs`.
Tyler
> ---
> fs/ecryptfs/keystore.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index 2333203..6154cde 100644
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -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);
> --
> 1.7.8.6
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fs: ecryptfs: initialize payload_len in keystore.c
2013-01-17 19:08 ` Tyler Hicks
@ 2013-01-17 19:15 ` Simon Que
0 siblings, 0 replies; 3+ messages in thread
From: Simon Que @ 2013-01-17 19:15 UTC (permalink / raw)
To: Tyler Hicks; +Cc: ecryptfs, dustin.kirkland, Mandeep Baines
Hi Tyler --
> Is this to just quiet a useless compiler warning or is there a place
> were we actually use payload_len without initializing it? If we use it
> uninitialized, does it cause a crash or do we "handle" it in error
> paths? These details are factored in to determine if I need to send this
> to the stable team and if distros need to backport it. It also keeps me
> from scratching my head a year down the road when someone asks me about
> the patch with no commit message. :)
This is just to squash a compiler warning. Assuming
write_tag_64_packet() works as intended, if it fails to initialize
payload_len, it should return an error and the function should skip to
the end.
I'll re-send the patch with a comment explaining this.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-17 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 2:08 [PATCH] fs: ecryptfs: initialize payload_len in keystore.c Simon Que
2013-01-17 19:08 ` Tyler Hicks
2013-01-17 19:15 ` Simon Que
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox