pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/print/zathura-pdf-mupdf
Module Name: pkgsrc
Committed By: leot
Date: Sat Feb 18 13:38:33 UTC 2017
Modified Files:
pkgsrc/print/zathura-pdf-mupdf: Makefile distinfo
Added Files:
pkgsrc/print/zathura-pdf-mupdf/patches: patch-index.c patch-links.c
Log Message:
Avoid possible NULL pointer dereferencies in `Index mode' for PDF with index
pointing to non-existing pages.
Bump PKGREVISION
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 pkgsrc/print/zathura-pdf-mupdf/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/print/zathura-pdf-mupdf/distinfo
cvs rdiff -u -r0 -r1.3 pkgsrc/print/zathura-pdf-mupdf/patches/patch-index.c \
pkgsrc/print/zathura-pdf-mupdf/patches/patch-links.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/print/zathura-pdf-mupdf/Makefile
diff -u pkgsrc/print/zathura-pdf-mupdf/Makefile:1.13 pkgsrc/print/zathura-pdf-mupdf/Makefile:1.14
--- pkgsrc/print/zathura-pdf-mupdf/Makefile:1.13 Sun Feb 12 06:25:56 2017
+++ pkgsrc/print/zathura-pdf-mupdf/Makefile Sat Feb 18 13:38:33 2017
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.13 2017/02/12 06:25:56 ryoon Exp $
+# $NetBSD: Makefile,v 1.14 2017/02/18 13:38:33 leot Exp $
#
DISTNAME= zathura-pdf-mupdf-0.3.1
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= print
MASTER_SITES= http://pwmt.org/projects/zathura/plugins/download/
Index: pkgsrc/print/zathura-pdf-mupdf/distinfo
diff -u pkgsrc/print/zathura-pdf-mupdf/distinfo:1.5 pkgsrc/print/zathura-pdf-mupdf/distinfo:1.6
--- pkgsrc/print/zathura-pdf-mupdf/distinfo:1.5 Tue Jan 31 10:12:02 2017
+++ pkgsrc/print/zathura-pdf-mupdf/distinfo Sat Feb 18 13:38:33 2017
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.5 2017/01/31 10:12:02 leot Exp $
+$NetBSD: distinfo,v 1.6 2017/02/18 13:38:33 leot Exp $
SHA1 (zathura-pdf-mupdf-0.3.1.tar.gz) = ef37a181de96d6fca36db3ac818f790dcf3627ae
RMD160 (zathura-pdf-mupdf-0.3.1.tar.gz) = 7497475ba55d2e7f96d23f378cbefeddd56089e4
SHA512 (zathura-pdf-mupdf-0.3.1.tar.gz) = 87b5b8a750a6911be37a0195b0f4bc3304350f9d29173091b3eeece40350b10cb98b009b2722a69ae1e617b4242292f3eba17fea97d5276e485069180f2bd67d
Size (zathura-pdf-mupdf-0.3.1.tar.gz) = 9755 bytes
SHA1 (patch-document.c) = b4695700ffc3a85667a292af059d0af58b3150f1
+SHA1 (patch-index.c) = fbf31d17bbf979a74160db6d6838a11ce47d37f1
+SHA1 (patch-links.c) = 58581cbe1468ddf9c0e5a58e80c16586977be49b
Added files:
Index: pkgsrc/print/zathura-pdf-mupdf/patches/patch-index.c
diff -u /dev/null pkgsrc/print/zathura-pdf-mupdf/patches/patch-index.c:1.3
--- /dev/null Sat Feb 18 13:38:33 2017
+++ pkgsrc/print/zathura-pdf-mupdf/patches/patch-index.c Sat Feb 18 13:38:33 2017
@@ -0,0 +1,49 @@
+$NetBSD: patch-index.c,v 1.3 2017/02/18 13:38:33 leot Exp $
+
+Avoid possible NULL-pointer dereference.
+
+--- index.c.orig 2017-01-11 21:21:14.000000000 +0000
++++ index.c
+@@ -51,24 +51,26 @@ build_index(fz_context* ctx, fz_document
+ zathura_link_type_t type = ZATHURA_LINK_INVALID;
+ zathura_rectangle_t rect = { .x1 = 0, .y1 = 0, .x2 = 0, .y2 = 0 };
+
+- if (fz_is_external_link(ctx, outline->uri) == 1) {
+- if (strstr(outline->uri, "file://") == outline->uri) {
+- type = ZATHURA_LINK_GOTO_REMOTE;
+- target.value = outline->uri;
++ if (outline->uri) {
++ if (fz_is_external_link(ctx, outline->uri) == 1) {
++ if (strstr(outline->uri, "file://") == outline->uri) {
++ type = ZATHURA_LINK_GOTO_REMOTE;
++ target.value = outline->uri;
++ } else {
++ type = ZATHURA_LINK_URI;
++ target.value = outline->uri;
++ }
+ } else {
+- type = ZATHURA_LINK_URI;
+- target.value = outline->uri;
++ float x = 0;
++ float y = 0;
++
++ type = ZATHURA_LINK_GOTO_DEST;
++ target.destination_type = ZATHURA_LINK_DESTINATION_XYZ;
++ target.page_number = fz_resolve_link(ctx, document, outline->uri, &x, &y);
++ target.left = x;
++ target.top = y;
++ target.scale = 0.0;
+ }
+- } else {
+- float x = 0;
+- float y = 0;
+-
+- type = ZATHURA_LINK_GOTO_DEST;
+- target.destination_type = ZATHURA_LINK_DESTINATION_XYZ;
+- target.page_number = fz_resolve_link(ctx, document, outline->uri, &x, &y);
+- target.left = x;
+- target.top = y;
+- target.scale = 0.0;
+ }
+
+ index_element->link = zathura_link_new(type, rect, target);
Index: pkgsrc/print/zathura-pdf-mupdf/patches/patch-links.c
diff -u /dev/null pkgsrc/print/zathura-pdf-mupdf/patches/patch-links.c:1.3
--- /dev/null Sat Feb 18 13:38:33 2017
+++ pkgsrc/print/zathura-pdf-mupdf/patches/patch-links.c Sat Feb 18 13:38:33 2017
@@ -0,0 +1,51 @@
+$NetBSD: patch-links.c,v 1.3 2017/02/18 13:38:33 leot Exp $
+
+Avoid possible NULL-pointer dereference.
+
+--- links.c.orig 2017-01-11 21:21:14.000000000 +0000
++++ links.c
+@@ -43,25 +43,27 @@ pdf_page_links_get(zathura_page_t* page,
+ zathura_link_type_t type = ZATHURA_LINK_INVALID;
+ zathura_link_target_t target = { 0 };
+
+- if (fz_is_external_link(mupdf_document->ctx, link->uri) == 1) {
+- if (strstr(link->uri, "file://") == link->uri) {
+- type = ZATHURA_LINK_GOTO_REMOTE;
+- target.value = link->uri;
++ if (link->uri) {
++ if (fz_is_external_link(mupdf_document->ctx, link->uri) == 1) {
++ if (strstr(link->uri, "file://") == link->uri) {
++ type = ZATHURA_LINK_GOTO_REMOTE;
++ target.value = link->uri;
++ } else {
++ type = ZATHURA_LINK_URI;
++ target.value = link->uri;
++ }
+ } else {
+- type = ZATHURA_LINK_URI;
+- target.value = link->uri;
++ float x = 0;
++ float y = 0;
++
++ type = ZATHURA_LINK_GOTO_DEST;
++ target.destination_type = ZATHURA_LINK_DESTINATION_XYZ;
++ target.page_number = fz_resolve_link(mupdf_document->ctx,
++ mupdf_document->document, link->uri, &x, &y);
++ target.left = x;
++ target.top = y;
++ target.scale = 0.0;
+ }
+- } else {
+- float x = 0;
+- float y = 0;
+-
+- type = ZATHURA_LINK_GOTO_DEST;
+- target.destination_type = ZATHURA_LINK_DESTINATION_XYZ;
+- target.page_number = fz_resolve_link(mupdf_document->ctx,
+- mupdf_document->document, link->uri, &x, &y);
+- target.left = x;
+- target.top = y;
+- target.scale = 0.0;
+ }
+
+ zathura_link_t* zathura_link = zathura_link_new(type, position, target);
Home |
Main Index |
Thread Index |
Old Index