mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ameen <ameenali023@gmail.com>
To: herbert@gondor.apana.org.au, davem@davemloft.net, dhowells@redhat.com
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ameen <AmeenAli023@gmail.com>
Subject: [PATCH 2/2] updating for keypayload null check.
Date: Wed, 25 Nov 2015 21:04:15 +0200	[thread overview]
Message-ID: <1448478255-5443-1-git-send-email-AmeenAli023@gmail.com> (raw)

adding NULL check to make it fail safe.

Signed-Off-By : Ameen Ali <AmeenAli023@gmail.com>
---
 crypto/asymmetric_keys/x509_public_key.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c
index 2a44b37..76610cc 100644
--- a/crypto/asymmetric_keys/x509_public_key.c
+++ b/crypto/asymmetric_keys/x509_public_key.c
@@ -286,6 +286,10 @@ static int x509_key_preparse(struct key_preparsed_payload *prep)
 	char *desc = NULL, *p;
 	int ret;
 
+	if(prep == NULL){
+		pr_debug("NULL payload");
+		return PTR_ERR(prep);
+	}
 	cert = x509_cert_parse(prep->data, prep->datalen);
 	if (IS_ERR(cert))
 		return PTR_ERR(cert);
-- 
2.5.0


                 reply	other threads:[~2015-11-25 19:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448478255-5443-1-git-send-email-AmeenAli023@gmail.com \
    --to=ameenali023@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®