...
 
Commits (5)
# see git-dpm(1) from git-dpm package
2f0ceb374caef33242a50cde65465b33c9fc970e
2f0ceb374caef33242a50cde65465b33c9fc970e
7695b5412f338acd639fa385ebfcb6c25164effa
7695b5412f338acd639fa385ebfcb6c25164effa
2f0ceb374caef33242a50cde65465b33c9fc970e
2f0ceb374caef33242a50cde65465b33c9fc970e
gv_3.7.4.orig.tar.gz
......
gv (1:3.7.4-3) experimental; urgency=medium
* also register application/postscript in gv.mime (Closes: #902141)
* cherry-pick commits from unreleased upstream:
- Fix crash in zoom.c (Closes: #824745)
- Do not segfault on buggy postscript files (Closes: #729618, #924028)
-- Bernhard R. Link <brlink@debian.org> Sat, 09 Mar 2019 19:36:40 +0100
gv (1:3.7.4-2) unstable; urgency=medium
* bump Standards-Version
......
......@@ -6,5 +6,5 @@ Exec=gv
Icon=/usr/share/pixmaps/gv_icon.xpm
Terminal=false
Type=Application
MimeType=application/ps;application/pdf;
MimeType=application/postscript;application/ps;application/pdf;
Categories=Viewer;Graphics;
From f5e02eb52a4a25a16cbc48dd61f5dc9f50e1f5e5 Mon Sep 17 00:00:00 2001
From: Markus Steinborn <gnugv_maintainer@yahoo.de>
Date: Tue, 17 Dec 2013 19:16:55 +0100
Subject: =?UTF-8?q?Do=20not=20segfault=20on=20buggy=20postscript=20files,?=
=?UTF-8?q?=20i.=20e.=20files=0Ai.=20e.=20files=20where=20the=20page=20num?=
=?UTF-8?q?ber=20iin=20DSC=20comments=20is=20missing.?=
Fixes debian bug #729618: gv: segv on certain blank line
---
src/doc_misc.c | 4 +++-
src/misc.c | 12 +++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/doc_misc.c b/src/doc_misc.c
index 4cf0740..e595be8 100644
--- a/src/doc_misc.c
+++ b/src/doc_misc.c
@@ -84,7 +84,9 @@ doc_scanFile(fPP,docP,filename,filename_raw,filename_dscP,cmd_scan_pdf,filename_
ret = d->structured = 1;
if (d->numpages == 1) d->labels_useful=1;
else for (i = 1; i < d->numpages; i++)
- if (strcmp(d->pages[i-1].label,d->pages[i].label)) { d->labels_useful = 1; break; }
+ if (d->pages[i-1].label && d->pages[i].label) {
+ if (strcmp(d->pages[i-1].label,d->pages[i].label)) { d->labels_useful = 1; break; }
+ }
}
}
*docP = d;
diff --git a/src/misc.c b/src/misc.c
index d10c3b9..b5545c5 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -995,8 +995,11 @@ setup_ghostview(void)
INFMESSAGE(toc available)
if (doc->labels_useful) {
- for (i = 0; i < doc->numpages; i++)
- maxlen = max(maxlen, (int)strlen(doc->pages[i].label));
+ for (i = 0; i < doc->numpages; i++)
+ if (doc->pages[i].label)
+ maxlen = max(maxlen, (int)strlen(doc->pages[i].label));
+ else
+ maxlen = max(maxlen, log10((double) doc->numpages) + 2);
} else {
double x;
x = doc->numpages;
@@ -1014,7 +1017,10 @@ setup_ghostview(void)
} else {
j = i;
}
- sprintf(tocp, "%*s\n", maxlen, doc->pages[j].label);
+ if (doc->pages[j].label)
+ sprintf(tocp, "%*s\n", maxlen, doc->pages[j].label);
+ else
+ sprintf(tocp, "?%*d\n", maxlen-1, i+1);
} else {
sprintf(tocp, "%*d\n", maxlen, i+1);
}
From 7695b5412f338acd639fa385ebfcb6c25164effa Mon Sep 17 00:00:00 2001
From: Markus Steinborn <gnugv_maintainer@yahoo.de>
Date: Mon, 3 Mar 2014 16:25:53 +0100
Subject: Fix crash in zoom.c
---
src/zoom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/zoom.c b/src/zoom.c
index ccd964e..6c31645 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -104,7 +104,7 @@ zoom_createZoom(Widget w _GL_UNUSED, XtPointer call_data)
BEGINMESSAGE(zoom_createZoom)
- if (!(gv_psfile != NULL || (gv_gs_arguments && *gv_gs_arguments))) {
+ if (!gv_psfile) {
INFMESSAGE(no file) ENDMESSAGE(zoom_createZoom)
return;
}
0001-Do-not-segfault-on-buggy-postscript-files-i.-e.-file.patch
0002-Fix-crash-in-zoom.c.patch
......@@ -84,7 +84,9 @@ doc_scanFile(fPP,docP,filename,filename_raw,filename_dscP,cmd_scan_pdf,filename_
ret = d->structured = 1;
if (d->numpages == 1) d->labels_useful=1;
else for (i = 1; i < d->numpages; i++)
if (strcmp(d->pages[i-1].label,d->pages[i].label)) { d->labels_useful = 1; break; }
if (d->pages[i-1].label && d->pages[i].label) {
if (strcmp(d->pages[i-1].label,d->pages[i].label)) { d->labels_useful = 1; break; }
}
}
}
*docP = d;
......
......@@ -995,8 +995,11 @@ setup_ghostview(void)
INFMESSAGE(toc available)
if (doc->labels_useful) {
for (i = 0; i < doc->numpages; i++)
maxlen = max(maxlen, (int)strlen(doc->pages[i].label));
for (i = 0; i < doc->numpages; i++)
if (doc->pages[i].label)
maxlen = max(maxlen, (int)strlen(doc->pages[i].label));
else
maxlen = max(maxlen, log10((double) doc->numpages) + 2);
} else {
double x;
x = doc->numpages;
......@@ -1014,7 +1017,10 @@ setup_ghostview(void)
} else {
j = i;
}
sprintf(tocp, "%*s\n", maxlen, doc->pages[j].label);
if (doc->pages[j].label)
sprintf(tocp, "%*s\n", maxlen, doc->pages[j].label);
else
sprintf(tocp, "?%*d\n", maxlen-1, i+1);
} else {
sprintf(tocp, "%*d\n", maxlen, i+1);
}
......
......@@ -104,7 +104,7 @@ zoom_createZoom(Widget w _GL_UNUSED, XtPointer call_data)
BEGINMESSAGE(zoom_createZoom)
if (!(gv_psfile != NULL || (gv_gs_arguments && *gv_gs_arguments))) {
if (!gv_psfile) {
INFMESSAGE(no file) ENDMESSAGE(zoom_createZoom)
return;
}
......