Fix possible NULL dereference issue in X509 cert_req program
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
diff --git a/programs/x509/cert_req.c b/programs/x509/cert_req.c
index 558d8cc..bc4eb80 100644
--- a/programs/x509/cert_req.c
+++ b/programs/x509/cert_req.c
@@ -261,6 +261,9 @@
if ((subtype_value = strchr(q, ':')) != NULL) {
*subtype_value++ = '\0';
+ } else {
+ mbedtls_printf("Invalid argument for option SAN: Entry should be separated by a colon\n");
+ goto usage;
}
if (strcmp(q, "RFC822") == 0) {
cur->node.type = MBEDTLS_X509_SAN_RFC822_NAME;