summaryrefslogtreecommitdiff
path: root/app-text/mupdf/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-03 10:28:17 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-03 10:28:17 +0000
commitd99093fb4bb5652015c06274d64083daa2439e4f (patch)
treecf61513204d97974179580065e85df5c8009087c /app-text/mupdf/files
parent463397cf1e064185110fe57c568d73f99a06f5d1 (diff)
gentoo resync : 03.03.2021
Diffstat (limited to 'app-text/mupdf/files')
-rw-r--r--app-text/mupdf/files/mupdf-1.18.0-CVE-2021-3407.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/app-text/mupdf/files/mupdf-1.18.0-CVE-2021-3407.patch b/app-text/mupdf/files/mupdf-1.18.0-CVE-2021-3407.patch
new file mode 100644
index 000000000000..566ee562389c
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.18.0-CVE-2021-3407.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/772311
+
+From cee7cefc610d42fd383b3c80c12cbc675443176a Mon Sep 17 00:00:00 2001
+From: Robin Watts <Robin.Watts@artifex.com>
+Date: Fri, 22 Jan 2021 17:05:15 +0000
+Subject: [PATCH 1/1] Bug 703366: Fix double free of object during
+ linearization.
+
+This appears to happen because we parse an illegal object from
+a broken file and assign it to object 0, which is defined to
+be free.
+
+Here, we fix the parsing code so this can't happen.
+---
+ source/pdf/pdf-parse.c | 6 ++++++
+ source/pdf/pdf-xref.c | 2 ++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/source/pdf/pdf-parse.c b/source/pdf/pdf-parse.c
+index 7abc8c3d4..5761c3351 100644
+--- a/source/pdf/pdf-parse.c
++++ b/source/pdf/pdf-parse.c
+@@ -749,6 +749,12 @@ pdf_parse_ind_obj(fz_context *ctx, pdf_document *doc,
+ fz_throw(ctx, FZ_ERROR_SYNTAX, "expected generation number (%d ? obj)", num);
+ }
+ gen = buf->i;
++ if (gen < 0 || gen >= 65536)
++ {
++ if (try_repair)
++ *try_repair = 1;
++ fz_throw(ctx, FZ_ERROR_SYNTAX, "invalid generation number (%d)", gen);
++ }
+
+ tok = pdf_lex(ctx, file, buf);
+ if (tok != PDF_TOK_OBJ)
+diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
+index 1b2bdcd59..30197b4b8 100644
+--- a/source/pdf/pdf-xref.c
++++ b/source/pdf/pdf-xref.c
+@@ -1190,6 +1190,8 @@ pdf_read_new_xref(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf)
+ {
+ ofs = fz_tell(ctx, doc->file);
+ trailer = pdf_parse_ind_obj(ctx, doc, doc->file, buf, &num, &gen, &stm_ofs, NULL);
++ if (num == 0)
++ fz_throw(ctx, FZ_ERROR_GENERIC, "Trailer object number cannot be 0\n");
+ }
+ fz_catch(ctx)
+ {
+--
+2.17.1
+