Bug 47776 - [PATCH] ports/print/gv broken by recent security update
Summary: [PATCH] ports/print/gv broken by recent security update
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-01 00:30 UTC by Thomas Moestl
Modified: 2003-02-12 01:12 UTC (History)
0 users

See Also:


Attachments
file.diff (1.05 KB, patch)
2003-02-01 00:30 UTC, Thomas Moestl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Moestl freebsd_committer 2003-02-01 00:30:15 UTC
	The recent security update added a patch from Debian, which
	breaks gv for some previously working PostScript documents.
	The problem is the following change in the gv_3.5.8-26.1.diff.gz
	(from security.debian.org):

	+#define IS_END(comment)                                \
	+           (iscomment(line+5,(comment)))
	[...]
	-   else if IS_BEGIN("Document:")  SKIP_UNTIL_1("EndDocument")
	+   else if IS_BEGIN("Document:")  {  /* Skip the EPS without handling its content */
	+            while (line && !IS_END("Document")) {
	+               line = ps_io_fgetchars(fd,-1);
	+               if (line) *line_lenP += FD_LINE_LEN;
	+            }
	+   }

	It seems to be intended to handle embedded EPS files with
	unclosed sections. However, it has two problems: first, it does
	not check that the line in question is really an
	"%%EndDocument" comment, only that it contains the string
	"Document", starting on the fifth character on the line,
	which happens to occur in unrelated places in the problematic
	documents. This desynchronizes the rest of the file reader,
	and it will interpret the trailer/EOF of the embedded document
	as end of the parent document.
	Secondly, it does not skip over the the %%EndDocument line;
	this is non-fatal though.
	The attached patch should fix it. In case it gets mangled,
	a copy is at 'http://people.freebsd.org/~tmm/patch-source::ps.c'.

How-To-Repeat: 	An example of a broken document is
	http://www.sparc.com/standards/v9.ps.Z - only the first 3
	pages will be displayed.
Comment 1 Christian Weisgerber freebsd_committer 2003-02-12 01:11:47 UTC
State Changed
From-To: open->closed

Committed, thanks!