Bug 112665 - graphics/xpdf misprints on 64-bit archs
Summary: graphics/xpdf misprints on 64-bit archs
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: Norikatsu Shigemura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-14 21:10 UTC by Christian Weisgerber
Modified: 2007-09-02 16:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Weisgerber freebsd_committer freebsd_triage 2007-05-14 21:10:04 UTC
xpdf 3.02 misprints some documents on LP64 archs.  I discovered
this with the online tickets issued by Deutsche Bahn (German rail),
where the "bar code" area of the document is displayed correctly
on screen but made into a hash when printed, rendering the ticket
unusable.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-05-14 21:10:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->nork

Over to maintainer
Comment 2 Christian Weisgerber freebsd_committer freebsd_triage 2007-08-15 01:28:10 UTC
I have tracked down the bug.  It's a case of unexpected sign-extension
when an int expression is promoted to long when assigned to an
unsigned long variable.  I've sent a bug report to the xpdf author.

Suggested patch below.
(Note that patch-CVE-2007-3387 also touches xpdf/Stream.cc.  The changes
don't conflict, however.)

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/graphics/xpdf/Makefile,v
retrieving revision 1.78
diff -u -r1.78 Makefile
--- Makefile	31 Jul 2007 11:41:30 -0000	1.78
+++ Makefile	15 Aug 2007 00:21:36 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	xpdf
 PORTVERSION=	3.02
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	graphics print
 MASTER_SITES=	ftp://ftp.foolabs.com/pub/xpdf/ \
 		${MASTER_SITE_TEX_CTAN}
Index: files/patch-xpdf_Stream.cc
===================================================================
RCS file: files/patch-xpdf_Stream.cc
diff -N files/patch-xpdf_Stream.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-xpdf_Stream.cc	15 Aug 2007 00:21:36 -0000
@@ -0,0 +1,18 @@
+--- xpdf/Stream.cc.orig	Wed Aug 15 01:47:25 2007
++++ xpdf/Stream.cc	Wed Aug 15 01:48:32 2007
+@@ -4479,6 +4479,7 @@
+ 	n = 3;
+ 	t = (c0 << 24) | (c1 << 16) | (c2 << 8);
+       }
++      t &= 0xffffffff;
+       for (i = 4; i >= 0; --i) {
+ 	buf1[i] = (char)(t % 85 + 0x21);
+ 	t /= 85;
+@@ -4496,6 +4497,7 @@
+     eof = gTrue;
+   } else {
+     t = (c0 << 24) | (c1 << 16) | (c2 << 8) | c3;
++    t &= 0xffffffff;
+     if (t == 0) {
+       *bufEnd++ = 'z';
+       if (++lineLen == 65) {
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de
Comment 3 dfilter service freebsd_committer freebsd_triage 2007-09-02 16:21:08 UTC
nork        2007-09-02 15:21:03 UTC

  FreeBSD ports repository

  Modified files:
    graphics/xpdf        Makefile 
  Added files:
    graphics/xpdf/files  patch-xpdf_Stream.cc 
  Log:
  Fix misprints some documents on LP64 archs.
  
  PR:             ports/112665
  Submitted by:   naddy
  
  Revision  Changes    Path
  1.79      +1 -1      ports/graphics/xpdf/Makefile
  1.1       +18 -0     ports/graphics/xpdf/files/patch-xpdf_Stream.cc (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Norikatsu Shigemura freebsd_committer freebsd_triage 2007-09-02 16:21:15 UTC
State Changed
From-To: open->closed

Committed, thanks!