Merge pull request #8350 from waleed-elmelegy-arm/fix-null-dereference-in-x509-cert-write

Fix possible NULL dereference issue in X509 cert_write program
This commit is contained in:
Gilles Peskine
2023-10-18 10:03:36 +00:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -583,6 +583,10 @@ usage:
if ((subtype_value = strchr(q, ':')) != NULL) {
*subtype_value++ = '\0';
} else {
mbedtls_printf(
"Invalid argument for option SAN: Entry must be of the form TYPE:value\n");
goto usage;
}
if (strcmp(q, "RFC822") == 0) {
cur->node.type = MBEDTLS_X509_SAN_RFC822_NAME;