Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 1999 16:09:24 +0900 (JST)
From:      dcs@newsguy.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/9743: type is broken on ficl
Message-ID:  <199901280709.QAA00479@daniel.sobral>

next in thread | raw e-mail | index | archive | help

>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901280709.QAA00479>