From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) Message-Id: <10108041846.AA14518@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 13:46:24 -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: <8296-Sat04Aug2001211344+0300-eliz@is.elta.co.il> from "Eli Zaretskii" at Aug 04, 2001 09:13:45 PM X-Mailer: ELM [version 2.5 PL2] Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Precedence: bulk > > From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) > > Date: Sat, 4 Aug 2001 12:58:36 -0500 (CDT) > > > > If you want to be safe, dynamically allocate or make the size 32Kb. > > Do we have any reason to believe that 32KB is the limit? I suppose it could be 64Kb if they used the entire word for length ? I did an experiment - created 36 environment variables of 2040 characters each. Yes, Windows 2000 is happy with that. When I ran a DJGPP image all of those environment variables were not there - it seems to have only used 15Kb of environment space. But it's clear NT isn't limited to 32K (or even 64K) of total environment space and you don't have to pre-allocate the size. I haven't figured out a clever way to test the maximum environment variable size yet. I'd say malloc it and don't worry about it.