[net.sources.bugs] Larn bug + fix

mac@esl.UUCP (01/29/87)

	In larn 12, you could drop a huge number of gold pieces, and the
	sanity check would let you through, allowing you to drop much more gold
	tahn you had, and thereby decrement your current gold, and hence get a
	huge amount.

Repeat By:

	Play larn, and drop gold.  When it asks how much, type any number
	with 12 digits or more.  It will tell you that you have dropped a 
	huge negative amount, and you current holdings will be so huge 12 digit
	number.  The actual gold dropped will be ~1024.  AT this point it is
	quite trivial to purchase whatever you might like, and kill off all the
	monsters.  (watch going down the Volcano with 192,000,000,000 gold
	pieces.  Gold is rather heavy, and that much weighs millions!).

Fix by:
	applying this patch:


*** main.c	Thu Jan 29 12:15:24 1987
--- main.c~	Sun Aug 10 20:45:46 1986
***************
*** 880,891
  		while (i != '\n')
  			{
  			if (i=='\033') { scbr(); lprcat(" aborted"); return(0); }
! 			/* Fixed bug allowing you to drop 999999999 and
! 			   wrap the long around, getting a huge fortune,
! 			   but causing the program to think we dropped 0.
! 			   esl!cydrome!mac */
! 			if ((i <= '9') && (i >= '0') && (amt<99999999))
! 			    amt = amt*10+i-'0';
  			i = getchar();
  			}
  	scbr();  return(amt);

--- 880,887 -----
  		while (i != '\n')
  			{
  			if (i=='\033') { scbr(); lprcat(" aborted"); return(0); }
! 			if ((i <= '9') && (i >= '0') && (amt<999999999))
! 				amt = amt*10+i-'0';
  			i = getchar();
  			}
  	scbr();  return(amt);
-- 
 Michael Mc Namara                 
 ESL Incorporated                 
 ARPA: mac%esl@lll-lcc.ARPA