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