From 83e59fbba8f6705c514deb6b76f31578eaadcc39 Mon Sep 17 00:00:00 2001 From: thorpej Date: Fri, 27 Sep 1996 02:59:53 +0000 Subject: [PATCH] Fix SEGV when kludging old-style options. From Greg Stark , PR #2550. --- bin/ps/ps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 83f6ff963285..25425516167c 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1,4 +1,4 @@ -/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */ +/* $NetBSD: ps.c,v 1.16 1996/09/27 02:59:53 thorpej Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $"; +static char rcsid[] = "$NetBSD: ps.c,v 1.16 1996/09/27 02:59:53 thorpej Exp $"; #endif #endif /* not lint */ @@ -432,7 +432,7 @@ kludge_oldps_options(s) char *newopts, *ns, *cp; len = strlen(s); - if ((newopts = ns = malloc(len + 2)) == NULL) + if ((newopts = ns = malloc(len + 3)) == NULL) err(1, NULL); /* * options begin with '-'