Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345011 > unrolled thread

[PATCH] PKCS#7: fix unitialized boolean 'want'

Started byColin King <colin.king@canonical.com>
First post2016-02-27 13:50 +0100
Last post2016-02-29 15:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] PKCS#7: fix unitialized boolean 'want' Colin King <colin.king@canonical.com> - 2016-02-27 13:50 +0100
    Re: [PATCH] PKCS#7: fix unitialized boolean 'want' David Howells <dhowells@redhat.com> - 2016-02-29 15:30 +0100

#1345011 — [PATCH] PKCS#7: fix unitialized boolean 'want'

FromColin King <colin.king@canonical.com>
Date2016-02-27 13:50 +0100
Subject[PATCH] PKCS#7: fix unitialized boolean 'want'
Message-ID<r6MtP-30v-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1345863

FromDavid Howells <dhowells@redhat.com>
Date2016-02-29 15:30 +0100
Message-ID<r7wZH-4bg-9@gated-at.bofh.it>
In reply to#1345011
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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web