Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Sep 2019 20:26:53 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352420 - head/stand/forth
Message-ID:  <201909162026.x8GKQreB063974@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Mon Sep 16 20:26:53 2019
New Revision: 352420
URL: https://svnweb.freebsd.org/changeset/base/352420

Log:
  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:
  head/stand/forth/support.4th

Modified: head/stand/forth/support.4th
==============================================================================
--- head/stand/forth/support.4th	Mon Sep 16 18:40:27 2019	(r352419)
+++ head/stand/forth/support.4th	Mon Sep 16 20:26:53 2019	(r352420)
@@ -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?201909162026.x8GKQreB063974>