From MAILER-DAEMON Sun Dec 02 03:12:09 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Iyjvt-00013R-Lp
	for mharc-bug-ghostscript@gnu.org; Sun, 02 Dec 2007 03:12:09 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IyGAk-0000Z4-4t
	for bug-ghostscript@gnu.org; Fri, 30 Nov 2007 19:25:30 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IyGAh-0000YE-Db
	for bug-ghostscript@gnu.org; Fri, 30 Nov 2007 19:25:29 -0500
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IyGAh-0000YB-8m
	for bug-ghostscript@gnu.org; Fri, 30 Nov 2007 19:25:27 -0500
Received: from feith1.feith.com ([192.251.93.1])
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <john@feith.com>) id 1IyGAh-000364-3p
	for bug-ghostscript@gnu.org; Fri, 30 Nov 2007 19:25:27 -0500
Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16])
	by feith1.FEITH.COM (8.13.8+Sun/8.12.9) with ESMTP id lB10PCsv029287
	for <bug-ghostscript@gnu.org>; Fri, 30 Nov 2007 19:25:12 -0500 (EST)
	(envelope-from john@jwlab.FEITH.COM)
Received: from jwlab.FEITH.COM (localhost [127.0.0.1])
	by jwlab.FEITH.COM (8.13.8+Sun/8.13.8) with ESMTP id lB10PCjS027793
	for <bug-ghostscript@gnu.org>; Fri, 30 Nov 2007 19:25:12 -0500 (EST)
Received: (from john@localhost)
	by jwlab.FEITH.COM (8.13.8+Sun/8.13.8/Submit) id lB10PCSG027792
	for bug-ghostscript@gnu.org; Fri, 30 Nov 2007 19:25:12 -0500 (EST)
Date: Fri, 30 Nov 2007 19:25:12 -0500 (EST)
From: John Wehle <john@feith.com>
Message-Id: <200712010025.lB10PCSG027792@jwlab.FEITH.COM>
To: bug-ghostscript@gnu.org
MIME-Version: 1.0
Content-Type: text/plain
X-Scanned-By: MIMEDefang 2.62 on 192.251.93.1
X-Archived: cashew.FEITH.COM
X-detected-kernel: by monty-python.gnu.org: Solaris 9.1
X-Mailman-Approved-At: Sun, 02 Dec 2007 03:12:08 -0500
Subject: CMap crash (with fix) for GNU GhostScript 8.56
X-BeenThere: bug-ghostscript@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports and development for GNU GhostScript,
	the PostScript interpreter of the GNU project"
	<bug-ghostscript.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-ghostscript>,
	<mailto:bug-ghostscript-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-ghostscript>
List-Post: <mailto:bug-ghostscript@gnu.org>
List-Help: <mailto:bug-ghostscript-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-ghostscript>,
	<mailto:bug-ghostscript-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 01 Dec 2007 00:25:30 -0000

Ghostscript version: GNU GhostScript 8.56

Where you got Ghostscript: FTP'd from ftp.gnu.org:/gnu/ghostscript

Hardware you are using: Generic x86 platform

Operating system you are using: Sun Solaris 9 x86

C compiler you are using: GNU gcc 3.4.6

Symptoms: Using a CMap that has glyph names with a base font
          causes a crash in x_char_xglyph.  The problem is
          that code_map_decode_next_multidim_regime fails to
          clear pchr when returning the glyph as a result
          x_char_xglyph attempts to use the character code as
          an index to a gs_map_XXX_to_XXX array which can't
          possible work since the CMap character code is just
          an arbitrary string which only has meaning to the CMap.

          Sample file which causes the crash when using the X11
          output device is enclosed below.

Suggested fix (if any): Apply the patch encoded below and rebuild GhostScript.
--------------8<------------------8<-------------------8<--------------------
*** src/gsfcmap1.c.ORIGINAL	Mon May  7 07:21:46 2007
--- src/gsfcmap1.c	Mon Nov 26 21:07:58 2007
*************** code_map_decode_next_multidim_regime(con
*** 299,304 ****
--- 299,305 ----
                  return 0;
              case CODE_VALUE_GLYPH:
                  *pglyph = bytes2int(pvalue, pclr->value_size);
+                 *pchr = gs_no_char;
                  return 0;
              case CODE_VALUE_CHARS:
                  *pglyph =
--------------8<------------------8<-------------------8<--------------------
%!PS

%% Handle UTF-8 encoded Latin text.
%% Unicode ranges handled by the CMap:
%%
%%   U+20A0 - U+20AF
%%
%% Note that the actual usable characters is limited by the
%% available glyphs in the font.

/CIDInit /ProcSet findresource begin

12 dict begin

begincmap

/CMapName /Latin-UTF8-H def

/CMapType 1 def

/CIDSystemInfo [ null ] def

/WMode 0 def

4 begincodespacerange
  <00>       <7F>
  <C280>     <DFBF>
  <E0A080>   <E0BFBF>
  <E18080>   <ECBFBF>
endcodespacerange

16 beginbfchar
<E282A0> /uni20A0
<E282A1> /colonmonetary
<E282A2> /cruzeiro
<E282A3> /franc
<E282A4> /lira
<E282A5> /uni20A5
<E282A6> /uni20A6
<E282A7> /peseta
<E282A8> /uni20A8
<E282A9> /won
<E282AA> /afii57636
<E282AB> /dong
<E282AC> /Euro
<E282AD> /uni20AD
<E282AE> /uni20AE
<E282AF> /uni20AF
endbfchar

endcmap
CMapName currentdict /CMap defineresource pop
end
end

/Courier-UTF8 /Latin-UTF8-H [ /Courier ] composefont pop

/Courier-UTF8 12 selectfont

18 738 moveto (\342\202\254) show

showpage
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------




