delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/07/28/02:27:32

Date: Sun, 28 Jul 1996 09:23:29 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Subject: Transfer buffer usage in `spawnXX'
Message-Id: <Pine.SUN.3.91.960728091510.23430H-100000@is>
Mime-Version: 1.0

Currently, the function that allocates space off the transfer buffer
(`talloc' on `src/libc/dos/process/dosexec.c) doesn't check if the
transfer buffer space was exhausted, and will happily overwrite DOS memory
if e.g. your environment size (or the command line) is sufficiently 
large.  There are two ways of repairing this:

	* detect when all the buffer space has been used up, and return 
with -1 and errno = ENOMEM.

	* as above, but when the transfer buffer is exhausted, allocate 
larger buffer in low memory and use that to pass the parameters, then 
deallocate it when the child returns.

The second option of course adds to the size and complexity of the code, 
so I wonder if it's worth the hassle (I have it written, btw) and would 
appreciate any comments before I decide which version to submit.  Thanks.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019