diff mbox

[2/2] updating for keypayload null check.

Message ID 1448478255-5443-1-git-send-email-AmeenAli023@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show

Commit Message

Ameen Ali Nov. 25, 2015, 7:04 p.m. UTC
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 mbox

Patch

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);