* [PATCH] PKCS#7: fix unitialized boolean 'want'
@ 2016-02-27 12:45 Colin King
2016-02-29 14:29 ` David Howells
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-02-27 12:45 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, David Howells, James Morris,
Tadeusz Struk, Peter Jones, linux-crypto
Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The boolean want is not initialized and hence garbage. The default should
be false (later it is only set to true on tne sinfo->authattrs check).
Found with static analysis using CoverityScan
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
crypto/asymmetric_keys/pkcs7_parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_keys/pkcs7_parser.c
index 8f3056c..7a24e16 100644
--- a/crypto/asymmetric_keys/pkcs7_parser.c
+++ b/crypto/asymmetric_keys/pkcs7_parser.c
@@ -87,7 +87,7 @@ EXPORT_SYMBOL_GPL(pkcs7_free_message);
static int pkcs7_check_authattrs(struct pkcs7_message *msg)
{
struct pkcs7_signed_info *sinfo;
- bool want;
+ bool want = false;
sinfo = msg->signed_infos;
if (sinfo->authattrs) {
--
2.7.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] PKCS#7: fix unitialized boolean 'want'
2016-02-27 12:45 [PATCH] PKCS#7: fix unitialized boolean 'want' Colin King
@ 2016-02-29 14:29 ` David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2016-02-29 14:29 UTC (permalink / raw)
To: Colin King
Cc: dhowells, Herbert Xu, David S . Miller, James Morris,
Tadeusz Struk, Peter Jones, linux-crypto, linux-kernel
Colin King <colin.king@canonical.com> wrote:
> The boolean want is not initialized and hence garbage. The default should
> be false (later it is only set to true on tne sinfo->authattrs check).
>
> Found with static analysis using CoverityScan
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-29 14:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-27 12:45 [PATCH] PKCS#7: fix unitialized boolean 'want' Colin King
2016-02-29 14:29 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®