[gnu.ghostscript.bug] bugfix for core dump in scanner

snoopy@sopwith.UUCP (Snoopy) (06/27/89)

There is a bug in the version 1.3 scanner.  If a fractional number
is given without a digit to the left of the decimal point a double
variable is used before being set, causing a core dump.

Repeat by:

GS> 0.123		% works fine
GS>  .123		% core dumps

Fix: initialize the variable 'dval' to 0.0

RCS file: RCS/iscan.c,v
Retrieving revision 1.2
diff  -c -r1.2 iscan.c
*** /tmp/,RCSt1001206	Mon Jun 26 21:48:44 1989
--- iscan.c	Mon Jun 26 21:28:10 1989
***************
*** 340,345
  	double dval;
  	int code;
  	register int c;
  	switch ( c = sgetc(s) )
  	   {
  	case '+': sign = 1; c = sgetc(s); break;

--- 340,346 -----
  	double dval;
  	int code;
  	register int c;
+ 	dval = 0.0; /* initializing dval before use avoids core dumps -Snoopy */
  	switch ( c = sgetc(s) )
  	   {
  	case '+': sign = 1; c = sgetc(s); break;
***************

If you're wondering, the difference between RCS versions 1.1 and 1.2
is the removal of the trailing control-m chars.

    _____     						  .-----.
   /_____\    Snoopy					./  RIP	 \.
  /_______\   qiclab!sopwith!snoopy			|  	  |
    |___|     parsely!sopwith!snoopy			| tekecs  |
    |___|     sun!nosun!illian!sopwith!snoopy		|_________|

	I ain't 'fraid ah no Ghostscript bug!