From dcs@newsguy.com  Wed Jan 27 23:10:46 1999
Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA27238
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 27 Jan 1999 23:10:44 -0800 (PST)
          (envelope-from dcs@newsguy.com)
Received: from daniel.sobral by peach.ocn.ne.jp (8.9.1a/OCN) id QAA09498; Thu, 28 Jan 1999 16:10:41 +0900 (JST)
Received: (from root@localhost)
	by daniel.sobral (8.9.1/8.9.2) id QAA00479;
	Thu, 28 Jan 1999 16:09:24 +0900 (JST)
	(envelope-from root)
Message-Id: <199901280709.QAA00479@daniel.sobral>
Date: Thu, 28 Jan 1999 16:09:24 +0900 (JST)
From: dcs@newsguy.com
Reply-To: dcs@newsguy.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: type is broken on ficl
X-Send-Pr-Version: 3.2

>Number:         9743
>Category:       bin
>Synopsis:       type is broken on ficl
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 27 23:20:00 PST 1999
>Closed-Date:    Thu Feb 4 05:07:53 PST 1999
>Last-Modified:  Thu Feb  4 05:10:02 PST 1999
>Originator:     Daniel C. Sobral
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

	Current, since my "type" PR got in.

>Description:

	When I "fixed" type, I did so lousy a job, that I now fear Mike
is being too trusty...

	The buffer mallocated does not reserv space for the null at the
end, and, btw, it doesn't get used...

>How-To-Repeat:

	cp /usr/share/examples/bootforth/* /boot
	reboot

>Fix:
	
	Apply the following patch:


--- src/sys/boot/ficl/words.c	1999/01/28 06:37:54	1.12
+++ src/sys/boot/ficl/words.c	1999/01/28 06:55:55
@@ -2793,7 +2793,7 @@
 {
     UNS32 count = stackPopUNS32(pVM->pStack);
     char *cp    = stackPopPtr(pVM->pStack);
-    char *pDest = (char *)ficlMalloc(count);
+    char *pDest = (char *)ficlMalloc(count + 1);
 
     /* 
     ** Since we don't have an output primitive for a counted string
@@ -2806,7 +2806,7 @@
     strncpy(pDest, cp, count);
     pDest[count] = '\0';
 
-    vmTextOut(pVM, cp, 0);
+    vmTextOut(pVM, pDest, 0);
 
     ficlFree(pDest);
     return;
>Release-Note:
>Audit-Trail:

From: dcs@newsguy.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: bin/9743: type is broken on ficl
Date: Thu, 28 Jan 1999 16:09:24 +0900 (JST)

 >Number:         9743
 >Category:       bin
 >Synopsis:       type is broken on ficl
 >Confidential:   no
 >Severity:       serious
 >Priority:       medium
 >Responsible:    freebsd-bugs
 >State:          open
 >Quarter:        
 >Keywords:       
 >Date-Required:
 >Class:          sw-bug
 >Submitter-Id:   current-users
 >Arrival-Date:   Wed Jan 27 23:20:00 PST 1999
 >Closed-Date:
 >Last-Modified:
 >Originator:     Daniel C. Sobral
 >Release:        FreeBSD 4.0-CURRENT i386
 >Organization:
 >Environment:
 
 	Current, since my "type" PR got in.
 
 >Description:
 
 	When I "fixed" type, I did so lousy a job, that I now fear Mike
 is being too trusty...
 
 	The buffer mallocated does not reserv space for the null at the
 end, and, btw, it doesn't get used...
 
 >How-To-Repeat:
 
 	cp /usr/share/examples/bootforth/* /boot
 	reboot
 
 >Fix:
 	
 	Apply the following patch:
 
 
 --- src/sys/boot/ficl/words.c	1999/01/28 06:37:54	1.12
 +++ src/sys/boot/ficl/words.c	1999/01/28 06:55:55
 @@ -2793,7 +2793,7 @@
  {
      UNS32 count = stackPopUNS32(pVM->pStack);
      char *cp    = stackPopPtr(pVM->pStack);
 -    char *pDest = (char *)ficlMalloc(count);
 +    char *pDest = (char *)ficlMalloc(count + 1);
  
      /* 
      ** Since we don't have an output primitive for a counted string
 @@ -2806,7 +2806,7 @@
      strncpy(pDest, cp, count);
      pDest[count] = '\0';
  
 -    vmTextOut(pVM, cp, 0);
 +    vmTextOut(pVM, pDest, 0);
  
      ficlFree(pDest);
      return;
 >Release-Note:
 >Audit-Trail:
 >Unformatted:
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message
State-Changed-From-To: open->closed 
State-Changed-By: dcs 
State-Changed-When: Thu Feb 4 05:07:53 PST 1999 
State-Changed-Why:  
Committed. 
>Unformatted:
