delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/04/14:02:28

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10108041758.AA16232@clio.rice.edu>
Subject: Re: Bash 2.05 buffer overrun problem
To: eliz AT is DOT elta DOT co DOT il
Date: Sat, 4 Aug 2001 12:58:36 -0500 (CDT)
Cc: pjfarley AT dorsai DOT org, djgpp-workers AT delorie DOT com, snowball3 AT bigfoot DOT com,
acottrel AT ihug DOT com DOT au
In-Reply-To: <2561-Sat04Aug2001184101+0300-eliz@is.elta.co.il> from "Eli Zaretskii" at Aug 04, 2001 06:41:02 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> That's the upper limit, but it is for all of the variables combined.
> An individual variable's value cannot be larger than 1024 on Windows 9X;
> if you try, you will crash COMMAND.COM.

You can set environment variables longer than 1024 on Windows NT (under
CMD.EXE), and when viewed from a DJGPP image you see the entire thing.
For example, I just created a 2040 byte environment variable on Windows
2000 and strlen(getenv()) returns 2040 on DJGPP.  NT gives me an error
about line to long if I try to go more than that via a BAT file, but
it's quite possible to set them longer using tools like the startup
in the registry.

If you want to be safe, dynamically allocate or make the size 32Kb.

- Raw text -


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