Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Oct 2019 04:12:38 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r354012 - stable/12/stand/forth
Message-ID:  <201910240412.x9O4CcPx049416@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Oct 24 04:12:38 2019
New Revision: 354012
URL: https://svnweb.freebsd.org/changeset/base/354012

Log:
  MFC r352420: loader_4th: scan_buffer can leave empty string on stack
  
  When the file processing is done, we will have string with lenght 0 in stack
  and we will attempt to
  allocate 0 bytes.

Modified:
  stable/12/stand/forth/support.4th
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/stand/forth/support.4th
==============================================================================
--- stable/12/stand/forth/support.4th	Thu Oct 24 04:08:24 2019	(r354011)
+++ stable/12/stand/forth/support.4th	Thu Oct 24 04:12:38 2019	(r354012)
@@ -363,6 +363,7 @@ variable fd
 ;
 
 : line_buffer_resize  ( len -- len )
+  dup 0= if exit then
   >r
   line_buffer .len @ if
     line_buffer .addr @
@@ -376,6 +377,7 @@ variable fd
 ;
     
 : append_to_line_buffer  ( addr len -- )
+  dup 0= if 2drop exit then
   line_buffer strget
   2swap strcat
   line_buffer .len !



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