Fix an error to prevent some core dumps from ps.

You can get ps easily to core dump, if you are running a "make depend"
on a kernel in one window and a "ps -auxww" in another. The ww will
try to give you the full argument list of the command that can
now be 64Kb large, but ps expected only 4Kb large arg arrays and
doesn't check for overflows.
This commit is contained in:
Andreas Schulz 1994-11-10 23:25:12 +00:00
parent 1113f91681
commit fa49dc9cf0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4347

View file

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: fmt.c,v 1.3 1994/09/24 02:56:43 davidg Exp $
*/
#ifndef lint
@ -38,6 +38,7 @@ static char sccsid[] = "@(#)fmt.c 8.4 (Berkeley) 4/15/94";
#endif /* not lint */
#include <sys/param.h>
#include <sys/syslimits.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <ctype.h>
@ -59,7 +60,7 @@ shquote(argv)
char **argv;
{
char **p, *dst, *src;
static char buf[4096]; /* XXX */
static char buf[ARG_MAX]; /* XXX */
if (*argv == 0) {
buf[0] = 0;