From 7c82340cd6422a37c57122295ebbda637b76d582 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Sun, 31 May 2020 16:18:46 +0200 Subject: [PATCH] fix signature check crash --- ...sh-when-using-openssl-for-digital-si.patch | 27 +++++++++++++++++++ mupdf.spec | 7 ++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-possible-crash-when-using-openssl-for-digital-si.patch diff --git a/0001-Fix-possible-crash-when-using-openssl-for-digital-si.patch b/0001-Fix-possible-crash-when-using-openssl-for-digital-si.patch new file mode 100644 index 0000000..0d80397 --- /dev/null +++ b/0001-Fix-possible-crash-when-using-openssl-for-digital-si.patch @@ -0,0 +1,27 @@ +From a38556c13b132c2e3b275fac0d2e2f0f32895036 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Paul Gardiner +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 + diff --git a/mupdf.spec b/mupdf.spec index c19b4cd..6a2c6f7 100644 --- a/mupdf.spec +++ b/mupdf.spec @@ -1,6 +1,6 @@ Name: mupdf Version: 1.17.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A lightweight PDF viewer and toolkit License: AGPLv3+ URL: http://mupdf.com/ @@ -23,6 +23,7 @@ Provides: bundled(freeglut-devel) = 3.0.0 Provides: bundled(mujs-devel) = 1.0.5 Patch0: 0001-fix-build-on-big-endian.patch Patch1: 0001-fix-build-with-gcc-10.patch +Patch2: 0001-Fix-possible-crash-when-using-openssl-for-digital-si.patch %description MuPDF is a lightweight PDF viewer and toolkit written in portable C. @@ -56,6 +57,7 @@ do done %patch0 -p1 -d thirdparty/lcms2 %patch1 -p1 -d thirdparty/freeglut +%patch2 -p1 echo > user.make "\ USE_SYSTEM_FREETYPE := yes USE_SYSTEM_HARFBUZZ := yes @@ -102,6 +104,9 @@ cd %{buildroot}/%{_bindir} && ln -s %{name}-x11 %{name} %{_libdir}/lib%{name}*.a %changelog +* Sun May 31 2020 Michael J Gruber - 1.17.0-2 +- fix signature check crash + * Mon May 11 2020 Michael J Gruber - 1.17.0-1 - rebase to 1.17.0 (bz #1831652)