mupdf/0001-Fix-possible-crash-when-using-openssl-for-digital-si.patch

28 lines
1.2 KiB
Diff
Raw Permalink Normal View History

2020-05-31 14:18:46 +00:00
From a38556c13b132c2e3b275fac0d2e2f0f32895036 Mon Sep 17 00:00:00 2001
Message-Id: <a38556c13b132c2e3b275fac0d2e2f0f32895036.1590932097.git.mjg@fedoraproject.org>
From: Paul Gardiner <paul.gardiner@artifex.com>
Date: Tue, 12 May 2020 17:21:18 +0100
Subject: [PATCH] Fix possible crash when using openssl for digital signature
support.
---
source/helpers/pkcs7/pkcs7-openssl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/helpers/pkcs7/pkcs7-openssl.c b/source/helpers/pkcs7/pkcs7-openssl.c
index dfb99bb8c..a0a15fbd5 100644
--- a/source/helpers/pkcs7/pkcs7-openssl.c
+++ b/source/helpers/pkcs7/pkcs7-openssl.c
@@ -606,7 +606,7 @@ static char *x509_get_name_entry_string(fz_context *ctx, X509_NAME *name, int ni
int idx = X509_NAME_get_index_by_NID(name, nid, -1);
X509_NAME_ENTRY *entry = X509_NAME_get_entry(name, idx);
ASN1_STRING *data = X509_NAME_ENTRY_get_data(entry);
- return fz_strdup(ctx, (const char *)ASN1_STRING_get0_data(data));
+ return data ? fz_strdup(ctx, (const char *)ASN1_STRING_get0_data(data)) : NULL;
}
static pdf_pkcs7_designated_name *x509_designated_name(fz_context *ctx, X509 *x509)
--
2.27.0.rc1.210.gb37d18b052