tss2/SOURCES/0001-ekutils-fix-null-check-in-convertPemToX509.patch
2021-10-08 18:00:55 +00:00

29 lines
981 B
Diff

From a73fda67a980fd8129ba3cc6158cd4f5d9be7562 Mon Sep 17 00:00:00 2001
From: Jerry Snitselaar <jsnitsel@redhat.com>
Date: Wed, 20 Jun 2018 11:01:21 -0700
Subject: [PATCH 1/3] ekutils: fix null check in convertPemToX509
assignment is to *x509, but check is against x509. Change check to *x509.
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
utils/ekutils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/ekutils.c b/utils/ekutils.c
index 5f27bd6..8887bd5 100644
--- a/utils/ekutils.c
+++ b/utils/ekutils.c
@@ -1144,7 +1144,7 @@ uint32_t convertPemToX509(X509 **x509, /* freed by caller */
/* convert the platform certificate from PEM to DER */
if (rc == 0) {
*x509 = PEM_read_X509(pemCertificateFile , NULL, NULL, NULL); /* freed @1 */
- if (x509 == NULL) {
+ if (*x509 == NULL) {
printf("convertPemToX509: Cannot parse PEM certificate file %s\n",
pemCertificateFilename);
rc = TSS_RC_FILE_READ;
--
2.17.0