Skip to contentSkip to conversation

updating for keypayload null check.

PATCH New Ameen 1 participant 1 message Nov 25, 2015

Subsystems (2)
lore
Share & tools
lore

Ameen

author
#0 lore raw

PATCH 2/2 updating for keypayload null check.

adding NULL check to make it fail safe.

---
 crypto/asymmetric_keys/x509_public_key.c | 4 ++++
 1 file changed, 4 insertions(+)
crypto/asymmetric_keys/x509_public_key.c +4 -0
index 2a44b37..76610cc 100644
@@ -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);
Signature · 1 line
2.5.0