From owner-freebsd-bugs Sat May 4 11:50:10 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8FBF937B41C for ; Sat, 4 May 2002 11:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g44Io1e70278; Sat, 4 May 2002 11:50:01 -0700 (PDT) (envelope-from gnats) Received: from mailgate.rz.uni-karlsruhe.de (mailgate.rz.uni-karlsruhe.de [129.13.64.97]) by hub.freebsd.org (Postfix) with ESMTP id B509237B419 for ; Sat, 4 May 2002 11:45:52 -0700 (PDT) Received: from nce2.hadiko.de (hadince2.hadiko.uni-karlsruhe.de [172.20.32.2]) by mailgate.rz.uni-karlsruhe.de with esmtp (Exim 3.33 #1) id 1744XX-0004mh-00; Sat, 04 May 2002 20:45:51 +0200 Received: from i609a.hadiko.de (hadii609a.hadiko.uni-karlsruhe.de [172.20.49.159]) by nce2.hadiko.de (8.11.3/8.11.3) with ESMTP id g44Ijoc05119 for ; Sat, 4 May 2002 20:45:50 +0200 (MET DST) Received: from i609a.hadiko.de (localhost [127.0.0.1]) by i609a.hadiko.de (8.12.3/8.12.3) with ESMTP id g44IjoUY000683 for ; Sat, 4 May 2002 20:45:50 +0200 (CEST) (envelope-from p@i609a.hadiko.de) Received: (from p@localhost) by i609a.hadiko.de (8.12.3/8.12.3/Submit) id g44IjoRj000682; Sat, 4 May 2002 20:45:50 +0200 (CEST) Message-Id: <200205041845.g44IjoRj000682@i609a.hadiko.de> Date: Sat, 4 May 2002 20:45:50 +0200 (CEST) From: Philipp Mergenthaler Reply-To: Philipp Mergenthaler To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: misc/37755: [PATCH] Small bug in loader's forth interpreter Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 37755 >Category: misc >Synopsis: [PATCH] Small bug in loader's forth interpreter >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat May 04 11:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Philipp Mergenthaler >Release: FreeBSD 5.0-CURRENT i386 >Organization: University of Karlsruhe >Environment: System: FreeBSD i609a.hadiko.de 5.0-CURRENT FreeBSD 5.0-CURRENT #533: Sat Apr 27 19:14:25 CEST 2002 p@i609a.hadiko.de:/usr/src/sys/i386/compile/I609 i386 >Description: Loader's forth interpreter has a bug regarding the command s" in interactive mode: when it copies the string into a scratch area it doesn't mark that area as used. Therefor a following s" command will overwrite the first string. (In compiled mode this works correctly.) >How-To-Repeat: At the loader's prompt, enter several s" commands and note that all strings are copied to the same address: OK s" foo" s" bar" . . . . 3 295013 3 295013 OK >Fix: Allocate the necessary space in stringQuoteIm(). This is analogous to cstringQuoteIm(). Index: words.c =================================================================== RCS file: /ncvs/src/sys/boot/ficl/words.c,v retrieving revision 1.37 diff -u -r1.37 words.c --- words.c 9 Apr 2002 17:45:11 -0000 1.37 +++ words.c 4 May 2002 17:07:59 -0000 @@ -3231,6 +3231,8 @@ vmGetString(pVM, sp, '\"'); PUSHPTR(sp->text); PUSHUNS(sp->count); + /* move HERE past string so it doesn't get overwritten. */ + dictAllot(dp, sp->count + sizeof(FICL_COUNT)); } else /* COMPILE state */ { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message