🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.v7
Article #101

space allocation bug in exec()

#101
From: utzoohcrrrg
Date: Tue, 30 Nov 1982 20:18
21 lines
773 bytes
This from Peter Ross of HCR:

/*
 * UNIX exec doesn't check to ensure that there is sufficient space
 * to store the necessary pointers (*argp[], *envp[]). It does
 * allocate space for the strings but depends on SINCR being
 * enough for the pointers.  The following program works when
 * LIMIT is 100 but fails when it is 1000.
 */

#define LIMIT	1000
char	*av[LIMIT+1];

main()
{
	int	i;

	for (i = 0; i < LIMIT; i++)
		av[i] = "x";
	execv("/bin/echo", av);
}
Technical Details
Message-ID: <bnews.hcr.273>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
From: utzoo!hcr!rrg
Newsgroups: net.bugs.v7
Title: space allocation bug in exec()
Article-I.D.: hcr.273
Posted: Tue Nov 30 20:18:31 1982
Received: Tue Nov 30 20:51:28 1982
Subject: space allocation bug in exec()
Date: Tue, 30 Nov 1982 20:18:31 +0000
Message-ID: <bnews.hcr.273>